/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import connectivity.QueryManager;
import java.awt.Color;
import java.awt.event.KeyEvent;

import java.sql.ResultSet;

import java.sql.Time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import main.BarApplication;
import model.Branch;
import model.Category;
import model.Course;
import model.DbUtils;
import model.Factuur;
import model.GroupActivity;
import model.Product;
import model.Staff;
import model.Studio;
import model.Validator;
//import net.proteanit.sql.DbUtils;

/**
 *
 * @author Home
 */
public class Beheer extends javax.swing.JPanel {

    private ResultSet rs;
    private String firstName;
    private String middleName;
    private String lastName;
    private String gender;
    private String birthday;
    private String mobilePhone;
    private String emailAddress;
    private String password;
    private String functionname;
    private int functionId;
    private int branchId;
    private int medewerkerId;
    private int ActiviteitId;
    private int activiteitId;
    private int StudioID;
    private int activiteit;
    private GroupActivity activityRooster;
    private Staff medewerker;
    private Branch branch;
    private Studio studio;
    private GroupActivity activity;
    private int productId;
    private Product product;
    private Course course;
    private Category categorie;
    private int categotyId;
    private int categotynaam;
    private int MaincategotyId;
    private Category Maincategorie;
    private int cursusId;
    private Course cursusrooster;
    private Course cursus;
    private int cursusroosterId;
    private String cursusnaam;
    private int ActiviteitroosterId;
    private int row;
    private LoginScreen login;
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
    Calendar calendar = Calendar.getInstance();
    SimpleDateFormat dateFormatJaar = new SimpleDateFormat("yyyy");
    DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
    Calendar cal = Calendar.getInstance();
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------

    /**
     * Creates new form Beheer
     */
    public Beheer(LoginScreen login) {


//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
        initComponents();
        this.login = login;
        tableMedewerker();
        tableProduct();
        tableCategorie();
        tableActiviteit();
        tableActiviteitrooster();
        tableCusus();
        tableCususrooster();

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
        addFunctionItemsTocomboBoX();
        addFunctionItemsTocomboBoXVestigin();
        addStudionItemsTocomboBoXStudio();
        //addActivitytemsTocomboBoX();
        addCatgorieItemsTocomboBoX();
        addMaiCatgorieItemsTocomboBoX();
        //addCoursesItemsTocomboBoX();

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
//        jSpinner_uur.setEditor(new JSpinner.DateEditor(jSpinner_uur, "HH:mm:ss"));
//        jTextField_begintijd.setText(dateFormat.format(cal.getTime()));
//        jTextField_eindtijd.setText(dateFormat.format(cal.getTime()));
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
        jComboBox_dag_Activity.removeAllItems();
        String[] dag = {"Selecteer een dag",
            "Maandag",
            "Dinsdag",
            "Woensdag",
            "Donderdag",
            "Vrijdag",
            "Zaterdag",
            "Zondag"
        };


//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
        for (String value : dag) {
            jComboBox_dag_Activity.addItem(value);
            jComboBox_dagen.addItem(value);
        }
//-----------------------------------------------------------------------------
// 
//-----------------------------------------------------------------------------
        int jaar;
        //Huidige dag opvragen today
        jaar = Integer.parseInt(dateFormatJaar.format(calendar.getTime()));
        jComboBox_Jaar.removeAllItems();
        for (int i = jaar; i > 1920; i--) {
            jComboBox_Jaar.addItem(Integer.toString(i));
        }
        jComboBox_Maand.removeAllItems();
        for (int i = 1; i < 13; i++) {
            jComboBox_Maand.addItem(Integer.toString(i));
        }
        jComboBox_Dag.removeAllItems();
        for (int i = 1; i < 32; i++) {
            jComboBox_Dag.addItem(Integer.toString(i));
        }


        jTextArea_Activity.setCaretPosition(jTextArea_Activity.getDocument().getLength());
    }

//-----------------------------------------------------------------------------
//  Hiermee wordt de tableMedewerker gelinkt aan de database
//-----------------------------------------------------------------------------
    private void tableMedewerker() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_Staff.setModel(DbUtils.resultSetToTableModel(queryManager.MedewerkersList(rs)));

    }
//-----------------------------------------------------------------------------
//  Hiermee wordt de tableProduct gelinkt aan de database
//-----------------------------------------------------------------------------

    private void tableProduct() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_Product.setModel(DbUtils.resultSetToTableModel(queryManager.ProductList(rs)));
        jTable_Product.removeColumn(jTable_Product.getColumnModel().getColumn(0));// REMOVE FISRT COLUMN 
    }
//-----------------------------------------------------------------------------
//  Hiermee wordt de tableCategorie gelinkt aan de database
//-----------------------------------------------------------------------------

    private void tableCategorie() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_categorie.setModel(DbUtils.resultSetToTableModel(queryManager.CategorieList(rs)));
        jTable_categorie.removeColumn(jTable_categorie.getColumnModel().getColumn(0));// REMOVE FISRT COLUMN 
    }
//-----------------------------------------------------------------------------
//  Hiermee wordt de tableActiviteit gelinkt aan de database
//-----------------------------------------------------------------------------

    private void tableActiviteitrooster() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_Activiteitrooster.setModel(DbUtils.resultSetToTableModel(queryManager.GroupActivityroosterList(rs)));
        jTable_Activiteitrooster.removeColumn(jTable_Activiteitrooster.getColumnModel().getColumn(0));// REMOVE FISRT COLUMN 
    }
    //-----------------------------------------------------------------------------
//  Hiermee wordt de tableActiviteit gelinkt aan de database
//-----------------------------------------------------------------------------

    private void tableActiviteit() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_Activiteit.setModel(DbUtils.resultSetToTableModel(queryManager.GroupActivityList(rs)));
        jTable_Activiteit.removeColumn(jTable_Activiteit.getColumnModel().getColumn(0)); // REMOVE FISRT COLUMN 

    }
//-----------------------------------------------------------------------------
//  Hiermee wordt de TableCusus gelinkt aan de database
//------------------------------------------------------------------------------

    private void tableCusus() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_cursus1.setModel(DbUtils.resultSetToTableModel(queryManager.CususList(rs)));
        jTable_cursus1.removeColumn(jTable_cursus1.getColumnModel().getColumn(0)); // REMOVE FISRT COLUMN 
    }
    //-----------------------------------------------------------------------------
//  Hiermee wordt de TableCususrooster gelinkt aan de database
//------------------------------------------------------------------------------

    private void tableCususrooster() {
        QueryManager queryManager = BarApplication.getQueryManager();
        jTable_cursusrooter.setModel(DbUtils.resultSetToTableModel(queryManager.CususroosterList(rs)));
        jTable_cursusrooter.removeColumn(jTable_cursusrooter.getColumnModel().getColumn(0)); // REMOVE FISRT COLUMN 
    }
//-----------------------------------------------------------------------------
// Funtie uit database voor de ComboBox
//-----------------------------------------------------------------------------

    private void addFunctionItemsTocomboBoX() {
        QueryManager queryManager = BarApplication.getQueryManager();
        List<Staff> staff = queryManager.getfunction();
        for (int i = 0; i < staff.size(); i++) {
            Staff stafffuntie = staff.get(i);
            jComboBox_functie.addItem(stafffuntie.getFuntionname());

        }
    }

//-----------------------------------------------------------------------------
// Funtie uit database voor de ComboBox
//-----------------------------------------------------------------------------
    private void addActivitytemsTocomboBoX() {
        jComboBox_Activity.addItem("Selecteer een activiteit");
        QueryManager queryManager = BarApplication.getQueryManager();
        List<GroupActivity> groupActivity = queryManager.GroupActivity();
        for (int i = 0; i < groupActivity.size(); i++) {
            GroupActivity Activity = groupActivity.get(i);
            jComboBox_Activity.addItem(Activity.getActivityname());

        }
    }
//-----------------------------------------------------------------------------
// Studio uit database voor de ComboBox
//-------------------------------------------------------------------------

    private void addStudionItemsTocomboBoXStudio() {
        QueryManager queryManager = BarApplication.getQueryManager();
        List<Branch> branchCombo = queryManager.getStudioList();
        for (int i = 0; i < branchCombo.size(); i++) {
            Branch studiocombo = branchCombo.get(i);
            jComboBox_Studio.addItem(studiocombo.getStudio());
            jComboBox_Studio_cursus.addItem(studiocombo.getStudio());

        }
    }
//-----------------------------------------------------------------------------
// Vestiging uit database voor de ComboBox
//-------------------------------------------------------------------------

    private void addFunctionItemsTocomboBoXVestigin() {
        QueryManager queryManager = BarApplication.getQueryManager();
        List<Branch> branch1 = queryManager.getVestigingList();
        for (int i = 0; i < branch1.size(); i++) {
            Branch vestiging = branch1.get(i);
            jComboBox_Vestiging.addItem(vestiging.getEstablishment());
            jComboBox_vestiging_curusus.addItem(vestiging.getEstablishment());

        }
    }
//-----------------------------------------------------------------------------
// categorie uit database voor de ComboBox
//-------------------------------------------------------------------------

    private void addCatgorieItemsTocomboBoX() {
        QueryManager queryManager = BarApplication.getQueryManager();
        List<Category> category = queryManager.getCategories();
        for (int i = 0; i < category.size(); i++) {
            Category cat = category.get(i);
            jComboBox_ProductenCategorie.addItem(cat.getName());


        }
    }
    //-----------------------------------------------------------------------------
// MainCategorie uit database voor de ComboBox
//-------------------------------------------------------------------------

    private void addMaiCatgorieItemsTocomboBoX() {
        QueryManager queryManager = BarApplication.getQueryManager();
        List<Category> maiCatgorie = queryManager.getMainCategory();
        for (int i = 0; i < maiCatgorie.size(); i++) {
            Category cat = maiCatgorie.get(i);
            jComboBox_categorie.addItem(cat.getMaincategoryname());


        }
    }
    //-----------------------------------------------------------------------------
// MainCategorie uit database voor de ComboBox
//-------------------------------------------------------------------------

    private void addCoursesItemsTocomboBoX() {
        jComboBox_cursusnaam.addItem("Selecteer een cursus");
        QueryManager queryManager = BarApplication.getQueryManager();
        List<Product> prodcombo = queryManager.getCurses();
        for (int i = 0; i < prodcombo.size(); i++) {
            Product Crs = prodcombo.get(i);
            jComboBox_cursusnaam.addItem(Crs.getName());

        }
    }

    /*-----------------------------------------------------------------------------
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     ------------------------------------------------------------------------------*/
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jPanel46 = new javax.swing.JPanel();
        jButton38 = new javax.swing.JButton();
        jButton_Save = new javax.swing.JButton();
        jButton40 = new javax.swing.JButton();
        jTextField18 = new javax.swing.JTextField();
        jButton25 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jCheckBox_Haarlem = new javax.swing.JCheckBox();
        jCheckBox_Purmerend = new javax.swing.JCheckBox();
        jCheckBox_Alkamaar = new javax.swing.JCheckBox();
        jPanel9 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jTextField_email = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jTextField_wachtwoord = new javax.swing.JPasswordField();
        Personalia_JPanel = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jCheckBox_Vrouw = new javax.swing.JCheckBox();
        jTextField_Tussenvoegsel = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jCheckBox_Man = new javax.swing.JCheckBox();
        jLabel1 = new javax.swing.JLabel();
        jTextField_Achternaam = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField_voornaam = new javax.swing.JTextField();
        jComboBox_Dag = new javax.swing.JComboBox();
        jComboBox_Maand = new javax.swing.JComboBox();
        jComboBox_Jaar = new javax.swing.JComboBox();
        jTextField_medewerkerId = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTextField_Mobilenummer = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jPanel_functie = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jComboBox_functie = new javax.swing.JComboBox();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable_Staff = new javax.swing.JTable();
        jPanel16 = new javax.swing.JPanel();
        jPanel34 = new javax.swing.JPanel();
        jLabel77 = new javax.swing.JLabel();
        prijs_TF = new javax.swing.JTextField();
        jLabel78 = new javax.swing.JLabel();
        jLabel79 = new javax.swing.JLabel();
        jLabel80 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jTextArea_productBeschr = new javax.swing.JTextArea();
        jTextField_Prodductnaam = new javax.swing.JTextField();
        jComboBox_ProductenCategorie = new javax.swing.JComboBox();
        jPanel36 = new javax.swing.JPanel();
        jButton21 = new javax.swing.JButton();
        jButton_SaveProduct = new javax.swing.JButton();
        jButton_newProduct = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable_Product = new javax.swing.JTable();
        jPanel32 = new javax.swing.JPanel();
        jPanel38 = new javax.swing.JPanel();
        jTextField_Categorie = new javax.swing.JTextField();
        jLabel82 = new javax.swing.JLabel();
        jLabel83 = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jTextArea_categorie = new javax.swing.JTextArea();
        jComboBox_categorie = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        jPanel45 = new javax.swing.JPanel();
        jButton35 = new javax.swing.JButton();
        jButton_Categorie = new javax.swing.JButton();
        jButton28 = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTable_categorie = new javax.swing.JTable();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel6 = new javax.swing.JPanel();
        jPanel47 = new javax.swing.JPanel();
        jButton24 = new javax.swing.JButton();
        jButton27 = new javax.swing.JButton();
        jButton_SaveCursus1 = new javax.swing.JButton();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTable_cursus1 = new javax.swing.JTable();
        Personalia_JPanel5 = new javax.swing.JPanel();
        jLabel69 = new javax.swing.JLabel();
        jLabel84 = new javax.swing.JLabel();
        jTextField_cursusnaam = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jTextField_Cursus_Prijs = new javax.swing.JTextField();
        jScrollPane14 = new javax.swing.JScrollPane();
        jTextArea_cursus = new javax.swing.JTextArea();
        jPanel1 = new javax.swing.JPanel();
        jPanel48 = new javax.swing.JPanel();
        jButton29 = new javax.swing.JButton();
        jButton30 = new javax.swing.JButton();
        jButton_SaveCursus2 = new javax.swing.JButton();
        jScrollPane10 = new javax.swing.JScrollPane();
        jTable_cursusrooter = new javax.swing.JTable();
        Personalia_JPanel6 = new javax.swing.JPanel();
        jLabel73 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel74 = new javax.swing.JLabel();
        jComboBox_Studio_cursus = new javax.swing.JComboBox();
        jComboBox_vestiging_curusus = new javax.swing.JComboBox();
        jLabel75 = new javax.swing.JLabel();
        jXDatePicker_Begingdatum = new org.jdesktop.swingx.JXDatePicker();
        jLabel50 = new javax.swing.JLabel();
        jXDatePicker_eniddatum = new org.jdesktop.swingx.JXDatePicker();
        jComboBox_cursusnaam = new javax.swing.JComboBox();
        jTextField_begintijd = new javax.swing.JTextField();
        jLabel51 = new javax.swing.JLabel();
        jTextField_eindtijd = new javax.swing.JTextField();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        jComboBox_dagen = new javax.swing.JComboBox();
        jLabel55 = new javax.swing.JLabel();
        jTextField_MaxAantal = new javax.swing.JTextField();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        jPanel8 = new javax.swing.JPanel();
        jPanel49 = new javax.swing.JPanel();
        jButton37 = new javax.swing.JButton();
        jButton_save_Activity = new javax.swing.JButton();
        jButton_add_activity = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable_Activiteit = new javax.swing.JTable();
        Personalia_JPanel3 = new javax.swing.JPanel();
        jLabel41 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jTextField7 = new javax.swing.JTextField();
        jTextField_Activity = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea_Activity = new javax.swing.JTextArea();
        jPanel7 = new javax.swing.JPanel();
        jPanel50 = new javax.swing.JPanel();
        jButton41 = new javax.swing.JButton();
        jButton_save_Activityrooster = new javax.swing.JButton();
        jButton_add_activityrooster = new javax.swing.JButton();
        jScrollPane12 = new javax.swing.JScrollPane();
        jTable_Activiteitrooster = new javax.swing.JTable();
        Personalia_JPanel7 = new javax.swing.JPanel();
        jLabel47 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jComboBox_Studio = new javax.swing.JComboBox();
        jComboBox_Vestiging = new javax.swing.JComboBox();
        jLabel59 = new javax.swing.JLabel();
        jComboBox_dag_Activity = new javax.swing.JComboBox();
        jComboBox_Activity = new javax.swing.JComboBox();
        jTextField_Tijd = new javax.swing.JTextField();
        jLabel60 = new javax.swing.JLabel();
        jLabel61 = new javax.swing.JLabel();
        jTextField_endtijd = new javax.swing.JTextField();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jXDatePicker_Begindatun_Activity = new org.jdesktop.swingx.JXDatePicker();
        jXDatePicker_Einddatun_Activity = new org.jdesktop.swingx.JXDatePicker();
        jPanel3 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jComboBox_jaar = new javax.swing.JComboBox();
        jLabel16 = new javax.swing.JLabel();
        jComboBox_maand = new javax.swing.JComboBox();
        jButton_csv = new javax.swing.JButton();
        jPanel_menu = new javax.swing.JPanel();
        home = new javax.swing.JLabel();
        leden = new javax.swing.JLabel();
        bar = new javax.swing.JLabel();
        factuur = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();

        setMinimumSize(new java.awt.Dimension(960, 360));
        setName(""); // NOI18N

        jTabbedPane1.setBackground(new java.awt.Color(102, 102, 102));
        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.LEFT);
        jTabbedPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jTabbedPane1.setMinimumSize(new java.awt.Dimension(113, 80));
        jTabbedPane1.setName(""); // NOI18N
        jTabbedPane1.setOpaque(true);

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));

        jPanel46.setBackground(new java.awt.Color(204, 204, 204));
        jPanel46.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jButton38.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton38.setText("Verwijderen");
        jButton38.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButton38.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton38ActionPerformed(evt);
            }
        });

        jButton_Save.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_Save.setText("Opslaan");
        jButton_Save.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButton_Save.setInheritsPopupMenu(true);
        jButton_Save.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SaveActionPerformed(evt);
            }
        });

        jButton40.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Actions-search-icon16.png"))); // NOI18N

        jButton25.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton25.setText("Nieuwe");
        jButton25.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButton25.setInheritsPopupMenu(true);
        jButton25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton25ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel46Layout = new javax.swing.GroupLayout(jPanel46);
        jPanel46.setLayout(jPanel46Layout);
        jPanel46Layout.setHorizontalGroup(
            jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel46Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton40)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, Short.MAX_VALUE)
                .addComponent(jButton25)
                .addGap(18, 18, 18)
                .addComponent(jButton_Save)
                .addGap(18, 18, 18)
                .addComponent(jButton38)
                .addGap(20, 20, 20))
        );
        jPanel46Layout.setVerticalGroup(
            jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel46Layout.createSequentialGroup()
                .addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel46Layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField18)
                            .addComponent(jButton40, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel46Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel46Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton25)
                            .addComponent(jButton_Save)
                            .addComponent(jButton38))))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jPanel5.setBackground(new java.awt.Color(204, 255, 204));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Primaire Locatie", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153))); // NOI18N
        jPanel5.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jLabel18.setText("Purmerend");

        jLabel19.setText("Alkmaar");

        jLabel20.setText("Haarlem");

        jCheckBox_Haarlem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox_HaarlemActionPerformed(evt);
            }
        });

        jCheckBox_Purmerend.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox_PurmerendActionPerformed(evt);
            }
        });

        jCheckBox_Alkamaar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox_AlkamaarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jCheckBox_Haarlem))
                    .addComponent(jLabel20))
                .addGap(31, 31, 31)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jCheckBox_Purmerend)
                        .addGap(59, 59, 59)
                        .addComponent(jCheckBox_Alkamaar))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addGap(29, 29, 29)
                        .addComponent(jLabel19)))
                .addContainerGap(26, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jLabel18)
                    .addComponent(jLabel19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCheckBox_Purmerend)
                    .addComponent(jCheckBox_Alkamaar)
                    .addComponent(jCheckBox_Haarlem))
                .addContainerGap(25, Short.MAX_VALUE))
        );

        jPanel9.setBackground(new java.awt.Color(204, 255, 204));
        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "login gegevens", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153))); // NOI18N
        jPanel9.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jLabel23.setText("E-mail adres");

        jLabel26.setText("Wachtwoord");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel26)
                    .addComponent(jLabel23)
                    .addComponent(jTextField_email, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
                    .addComponent(jTextField_wachtwoord))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_wachtwoord, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        Personalia_JPanel.setBackground(new java.awt.Color(204, 255, 204));
        Personalia_JPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(null, "Personalia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153)))); // NOI18N
        Personalia_JPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jLabel3.setText("Achternaam");

        jLabel2.setText("Tussenvoegsel");

        jCheckBox_Vrouw.setText(" V");
        jCheckBox_Vrouw.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox_VrouwActionPerformed(evt);
            }
        });

        jTextField_Tussenvoegsel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_TussenvoegselActionPerformed(evt);
            }
        });

        jLabel5.setText("Geslacht");

        jCheckBox_Man.setText(" M");
        jCheckBox_Man.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox_ManActionPerformed(evt);
            }
        });

        jLabel1.setText("Voornaam");

        jLabel4.setText("Geboortedatum");

        jTextField_voornaam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_voornaamActionPerformed(evt);
            }
        });

        jTextField_medewerkerId.setEditable(false);

        jLabel12.setText("ID");

        jLabel6.setText("Mobile nummer");

        javax.swing.GroupLayout Personalia_JPanelLayout = new javax.swing.GroupLayout(Personalia_JPanel);
        Personalia_JPanel.setLayout(Personalia_JPanelLayout);
        Personalia_JPanelLayout.setHorizontalGroup(
            Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField_Mobilenummer)
                    .addComponent(jTextField_Achternaam)
                    .addGroup(Personalia_JPanelLayout.createSequentialGroup()
                        .addGroup(Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(Personalia_JPanelLayout.createSequentialGroup()
                                .addComponent(jCheckBox_Man)
                                .addGap(10, 10, 10)
                                .addComponent(jCheckBox_Vrouw))
                            .addGroup(Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel3)
                                .addComponent(jLabel2)
                                .addComponent(jLabel1)
                                .addComponent(jLabel4)
                                .addComponent(jTextField_voornaam)
                                .addComponent(jTextField_Tussenvoegsel)
                                .addGroup(Personalia_JPanelLayout.createSequentialGroup()
                                    .addGroup(Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jComboBox_Dag, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGap(5, 5, 5)
                                    .addComponent(jComboBox_Maand, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jComboBox_Jaar, 0, 83, Short.MAX_VALUE)))
                            .addComponent(jLabel12)
                            .addComponent(jTextField_medewerkerId, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        Personalia_JPanelLayout.setVerticalGroup(
            Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanelLayout.createSequentialGroup()
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_medewerkerId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_voornaam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_Tussenvoegsel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_Achternaam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel4)
                .addGap(8, 8, 8)
                .addGroup(Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox_Dag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox_Maand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox_Jaar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(Personalia_JPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCheckBox_Man)
                    .addComponent(jCheckBox_Vrouw))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_Mobilenummer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(16, 16, 16))
        );

        jPanel_functie.setBackground(new java.awt.Color(204, 255, 204));
        jPanel_functie.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Functie", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153))); // NOI18N
        jPanel_functie.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jLabel13.setText("Functie");

        jComboBox_functie.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een functie" }));

        javax.swing.GroupLayout jPanel_functieLayout = new javax.swing.GroupLayout(jPanel_functie);
        jPanel_functie.setLayout(jPanel_functieLayout);
        jPanel_functieLayout.setHorizontalGroup(
            jPanel_functieLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_functieLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel_functieLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jComboBox_functie, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPanel_functieLayout.setVerticalGroup(
            jPanel_functieLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_functieLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBox_functie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jScrollPane4.setAutoscrolls(true);

        jTable_Staff.setAutoCreateRowSorter(true);
        jTable_Staff.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTable_Staff.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_StaffMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(jTable_Staff);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Personalia_JPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPanel_functie, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addComponent(jPanel46, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel46, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel_functie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(Personalia_JPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Medewerkers", new javax.swing.ImageIcon(getClass().getResource("/images/Office-Girl-icon48.png")), jPanel2); // NOI18N

        jPanel16.setBackground(new java.awt.Color(255, 255, 255));

        jPanel34.setBackground(new java.awt.Color(204, 255, 204));
        jPanel34.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel77.setText("Categorie");

        jLabel78.setText("Prijs");

        jLabel79.setText("Beschrijving");

        jLabel80.setText("Product naam");

        jTextArea_productBeschr.setColumns(20);
        jTextArea_productBeschr.setRows(5);
        jScrollPane7.setViewportView(jTextArea_productBeschr);

        jComboBox_ProductenCategorie.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een Categorie" }));

        javax.swing.GroupLayout jPanel34Layout = new javax.swing.GroupLayout(jPanel34);
        jPanel34.setLayout(jPanel34Layout);
        jPanel34Layout.setHorizontalGroup(
            jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(prijs_TF, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(jTextField_Prodductnaam)
                    .addGroup(jPanel34Layout.createSequentialGroup()
                        .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel80)
                            .addComponent(jLabel79)
                            .addComponent(jLabel77, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel78, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jComboBox_ProductenCategorie, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel34Layout.setVerticalGroup(
            jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel80)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_Prodductnaam, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel78)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(prijs_TF, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel77)
                .addGap(9, 9, 9)
                .addComponent(jComboBox_ProductenCategorie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel79)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel36.setBackground(new java.awt.Color(204, 204, 204));

        jButton21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton21.setText("Verwijderen");
        jButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton21ActionPerformed(evt);
            }
        });

        jButton_SaveProduct.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_SaveProduct.setText("Opslaan");
        jButton_SaveProduct.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_SaveProduct.setInheritsPopupMenu(true);
        jButton_SaveProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SaveProductActionPerformed(evt);
            }
        });

        jButton_newProduct.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton_newProduct.setText("Nieuwe");
        jButton_newProduct.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_newProduct.setInheritsPopupMenu(true);
        jButton_newProduct.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_newProductActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel36Layout = new javax.swing.GroupLayout(jPanel36);
        jPanel36.setLayout(jPanel36Layout);
        jPanel36Layout.setHorizontalGroup(
            jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel36Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton_newProduct)
                .addGap(18, 18, 18)
                .addComponent(jButton_SaveProduct)
                .addGap(18, 18, 18)
                .addComponent(jButton21)
                .addGap(20, 20, 20))
        );
        jPanel36Layout.setVerticalGroup(
            jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel36Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton21)
                    .addComponent(jButton_SaveProduct)
                    .addComponent(jButton_newProduct))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable_Product.setAutoCreateRowSorter(true);
        jTable_Product.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_Product.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_ProductMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable_Product);

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addGap(0, 0, 0)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel36, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(9, 9, 9))))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addComponent(jPanel36, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel34, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Products           ", new javax.swing.ImageIcon(getClass().getResource("/images/size32/basket-full-icon.png")), jPanel16); // NOI18N

        jPanel32.setBackground(new java.awt.Color(255, 255, 255));

        jPanel38.setBackground(new java.awt.Color(204, 255, 204));
        jPanel38.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel82.setText("Beschrijving");

        jLabel83.setText("Categorie naam");

        jTextArea_categorie.setColumns(20);
        jTextArea_categorie.setRows(5);
        jScrollPane9.setViewportView(jTextArea_categorie);

        jComboBox_categorie.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een categorie" }));

        jLabel8.setText("Categorie");

        javax.swing.GroupLayout jPanel38Layout = new javax.swing.GroupLayout(jPanel38);
        jPanel38.setLayout(jPanel38Layout);
        jPanel38Layout.setHorizontalGroup(
            jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel38Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
                    .addComponent(jTextField_Categorie)
                    .addGroup(jPanel38Layout.createSequentialGroup()
                        .addGroup(jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel38Layout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addComponent(jLabel83))
                            .addComponent(jLabel82)
                            .addComponent(jLabel8))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jComboBox_categorie, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel38Layout.setVerticalGroup(
            jPanel38Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel38Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel83)
                .addGap(2, 2, 2)
                .addComponent(jTextField_Categorie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBox_categorie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel82)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel45.setBackground(new java.awt.Color(204, 204, 204));

        jButton35.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton35.setText("Verwijderen");
        jButton35.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton35ActionPerformed(evt);
            }
        });

        jButton_Categorie.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_Categorie.setText("Opslaan");
        jButton_Categorie.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_Categorie.setInheritsPopupMenu(true);
        jButton_Categorie.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_CategorieActionPerformed(evt);
            }
        });

        jButton28.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton28.setText("Nieuwe");
        jButton28.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton28.setInheritsPopupMenu(true);
        jButton28.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton28ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel45Layout = new javax.swing.GroupLayout(jPanel45);
        jPanel45.setLayout(jPanel45Layout);
        jPanel45Layout.setHorizontalGroup(
            jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel45Layout.createSequentialGroup()
                .addContainerGap(375, Short.MAX_VALUE)
                .addComponent(jButton28)
                .addGap(18, 18, 18)
                .addComponent(jButton_Categorie)
                .addGap(18, 18, 18)
                .addComponent(jButton35)
                .addGap(20, 20, 20))
        );
        jPanel45Layout.setVerticalGroup(
            jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel45Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel45Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton35)
                    .addComponent(jButton_Categorie)
                    .addComponent(jButton28))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable_categorie.setAutoCreateRowSorter(true);
        jTable_categorie.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_categorie.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_categorieMouseClicked(evt);
            }
        });
        jScrollPane6.setViewportView(jTable_categorie);

        javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
        jPanel32.setLayout(jPanel32Layout);
        jPanel32Layout.setHorizontalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel45, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel32Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel38, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14))
        );
        jPanel32Layout.setVerticalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup()
                .addComponent(jPanel45, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jPanel38, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane1.addTab("Product Categories   ", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-category.png")), jPanel32); // NOI18N

        jTabbedPane2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane2MouseClicked(evt);
            }
        });

        jPanel47.setBackground(new java.awt.Color(204, 204, 204));

        jButton24.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton24.setText("Verwijderen");
        jButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton24ActionPerformed(evt);
            }
        });

        jButton27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton27.setText("Nieuwe");
        jButton27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton27.setInheritsPopupMenu(true);
        jButton27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton27ActionPerformed(evt);
            }
        });

        jButton_SaveCursus1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_SaveCursus1.setText("Opslaan");
        jButton_SaveCursus1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_SaveCursus1.setInheritsPopupMenu(true);
        jButton_SaveCursus1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SaveCursus1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel47Layout = new javax.swing.GroupLayout(jPanel47);
        jPanel47.setLayout(jPanel47Layout);
        jPanel47Layout.setHorizontalGroup(
            jPanel47Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel47Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton27)
                .addGap(18, 18, 18)
                .addComponent(jButton_SaveCursus1)
                .addGap(18, 18, 18)
                .addComponent(jButton24)
                .addGap(20, 20, 20))
        );
        jPanel47Layout.setVerticalGroup(
            jPanel47Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel47Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel47Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton24)
                    .addComponent(jButton27)
                    .addComponent(jButton_SaveCursus1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable_cursus1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_cursus1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_cursus1MouseClicked(evt);
            }
        });
        jScrollPane8.setViewportView(jTable_cursus1);

        Personalia_JPanel5.setBackground(new java.awt.Color(204, 255, 204));
        Personalia_JPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(null, "Personalia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153)))); // NOI18N

        jLabel69.setText("Cursus naam");

        jLabel84.setText("Beschrijving");

        jLabel15.setText("Prijs");

        jTextArea_cursus.setColumns(20);
        jTextArea_cursus.setRows(5);
        jScrollPane14.setViewportView(jTextArea_cursus);

        javax.swing.GroupLayout Personalia_JPanel5Layout = new javax.swing.GroupLayout(Personalia_JPanel5);
        Personalia_JPanel5.setLayout(Personalia_JPanel5Layout);
        Personalia_JPanel5Layout.setHorizontalGroup(
            Personalia_JPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Personalia_JPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField_cursusnaam)
                    .addGroup(Personalia_JPanel5Layout.createSequentialGroup()
                        .addGroup(Personalia_JPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel69)
                            .addComponent(jLabel84)
                            .addComponent(jLabel15))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jTextField_Cursus_Prijs)
                    .addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE))
                .addContainerGap())
        );
        Personalia_JPanel5Layout.setVerticalGroup(
            Personalia_JPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel5Layout.createSequentialGroup()
                .addComponent(jLabel69)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_cursusnaam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_Cursus_Prijs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel84)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Personalia_JPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jPanel47, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jPanel47, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Personalia_JPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane2.addTab("Cursus  ", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-article-add.png")), jPanel6); // NOI18N

        jPanel48.setBackground(new java.awt.Color(204, 204, 204));

        jButton29.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton29.setText("Verwijderen");
        jButton29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton29ActionPerformed(evt);
            }
        });

        jButton30.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton30.setText("Nieuwe");
        jButton30.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton30.setInheritsPopupMenu(true);
        jButton30.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton30ActionPerformed(evt);
            }
        });

        jButton_SaveCursus2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_SaveCursus2.setText("Opslaan");
        jButton_SaveCursus2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_SaveCursus2.setInheritsPopupMenu(true);
        jButton_SaveCursus2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SaveCursus2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel48Layout = new javax.swing.GroupLayout(jPanel48);
        jPanel48.setLayout(jPanel48Layout);
        jPanel48Layout.setHorizontalGroup(
            jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel48Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton30)
                .addGap(18, 18, 18)
                .addComponent(jButton_SaveCursus2)
                .addGap(18, 18, 18)
                .addComponent(jButton29)
                .addGap(20, 20, 20))
        );
        jPanel48Layout.setVerticalGroup(
            jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel48Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel48Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton29)
                    .addComponent(jButton30)
                    .addComponent(jButton_SaveCursus2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable_cursusrooter.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_cursusrooter.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_cursusrooterMouseClicked(evt);
            }
        });
        jScrollPane10.setViewportView(jTable_cursusrooter);

        Personalia_JPanel6.setBackground(new java.awt.Color(204, 255, 204));
        Personalia_JPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(null, "Personalia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153)))); // NOI18N

        jLabel73.setText("Cursus naam");

        jLabel48.setText("Begintijd");

        jLabel49.setText("Vestiging");

        jLabel74.setText("studio");

        jComboBox_Studio_cursus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een studio" }));

        jComboBox_vestiging_curusus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een vestiging" }));

        jLabel75.setText("Begingdatum");

        jXDatePicker_Begingdatum.setDoubleBuffered(true);

        jLabel50.setText("Einddatum");

        jComboBox_cursusnaam.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een cursus" }));
        jComboBox_cursusnaam.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBox_cursusnaamItemStateChanged(evt);
            }
        });

        jLabel51.setText("Eindtijd");

        jLabel52.setForeground(new java.awt.Color(0, 51, 153));
        jLabel52.setText("voorbeeld: 08:30");

        jLabel53.setBackground(new java.awt.Color(0, 51, 204));
        jLabel53.setForeground(new java.awt.Color(0, 51, 204));
        jLabel53.setText("voorbeeld: 09:30");

        jLabel54.setText("Dagen");

        jComboBox_dagen.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een dag" }));

        jLabel55.setText("Max aantal");

        javax.swing.GroupLayout Personalia_JPanel6Layout = new javax.swing.GroupLayout(Personalia_JPanel6);
        Personalia_JPanel6.setLayout(Personalia_JPanel6Layout);
        Personalia_JPanel6Layout.setHorizontalGroup(
            Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(Personalia_JPanel6Layout.createSequentialGroup()
                        .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel73)
                            .addComponent(jLabel49)
                            .addComponent(jLabel74))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jComboBox_vestiging_curusus, javax.swing.GroupLayout.Alignment.TRAILING, 0, 195, Short.MAX_VALUE)
                            .addComponent(jComboBox_Studio_cursus, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox_cursusnaam, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(Personalia_JPanel6Layout.createSequentialGroup()
                        .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel75)
                            .addComponent(jLabel50)
                            .addComponent(jLabel48)
                            .addComponent(jLabel51)
                            .addComponent(jLabel54)
                            .addComponent(jLabel55))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jXDatePicker_eniddatum, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jXDatePicker_Begingdatum, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox_dagen, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(Personalia_JPanel6Layout.createSequentialGroup()
                                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jTextField_begintijd, javax.swing.GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE)
                                    .addComponent(jTextField_eindtijd))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel52)
                                    .addComponent(jLabel53))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jTextField_MaxAantal))))
                .addContainerGap())
        );
        Personalia_JPanel6Layout.setVerticalGroup(
            Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel6Layout.createSequentialGroup()
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel73)
                    .addComponent(jComboBox_cursusnaam, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel49)
                    .addComponent(jComboBox_vestiging_curusus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox_Studio_cursus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel74, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel75)
                    .addComponent(jXDatePicker_Begingdatum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXDatePicker_eniddatum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel50))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_begintijd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel48)
                    .addComponent(jLabel52))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_eindtijd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel51)
                    .addComponent(jLabel53))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel54)
                    .addComponent(jComboBox_dagen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel55)
                    .addComponent(jTextField_MaxAantal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(25, 25, 25))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Personalia_JPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jPanel48, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel48, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(Personalia_JPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Cursusrooster    ", new javax.swing.ImageIcon(getClass().getResource("/images/size32/calendar-icon.png")), jPanel1); // NOI18N

        jTabbedPane1.addTab("Cursus", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-article-edit.png")), jTabbedPane2); // NOI18N

        jTabbedPane3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane3MouseClicked(evt);
            }
        });

        jPanel49.setBackground(new java.awt.Color(204, 204, 204));

        jButton37.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton37.setText("Verwijderen");
        jButton37.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton37ActionPerformed(evt);
            }
        });

        jButton_save_Activity.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_save_Activity.setText("Opslaan");
        jButton_save_Activity.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_save_Activity.setInheritsPopupMenu(true);
        jButton_save_Activity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_save_ActivityActionPerformed(evt);
            }
        });

        jButton_add_activity.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton_add_activity.setText("Nieuwe");
        jButton_add_activity.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_add_activity.setInheritsPopupMenu(true);
        jButton_add_activity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_add_activityActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel49Layout = new javax.swing.GroupLayout(jPanel49);
        jPanel49.setLayout(jPanel49Layout);
        jPanel49Layout.setHorizontalGroup(
            jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel49Layout.createSequentialGroup()
                .addContainerGap(370, Short.MAX_VALUE)
                .addComponent(jButton_add_activity)
                .addGap(18, 18, 18)
                .addComponent(jButton_save_Activity)
                .addGap(18, 18, 18)
                .addComponent(jButton37)
                .addGap(20, 20, 20))
        );
        jPanel49Layout.setVerticalGroup(
            jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel49Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel49Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton37)
                    .addComponent(jButton_save_Activity)
                    .addComponent(jButton_add_activity))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable_Activiteit.setAutoCreateRowSorter(true);
        jTable_Activiteit.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_Activiteit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_ActiviteitMouseClicked(evt);
            }
        });
        jTable_Activiteit.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTable_ActiviteitKeyReleased(evt);
            }
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTable_ActiviteitKeyPressed(evt);
            }
        });
        jScrollPane3.setViewportView(jTable_Activiteit);

        Personalia_JPanel3.setBackground(new java.awt.Color(204, 255, 204));
        Personalia_JPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(null, "Personalia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153)))); // NOI18N

        jLabel41.setText("Activiteit naam");

        jLabel43.setText("Beschrijving");

        jTextArea_Activity.setColumns(20);
        jTextArea_Activity.setRows(5);
        jScrollPane2.setViewportView(jTextArea_Activity);

        javax.swing.GroupLayout Personalia_JPanel3Layout = new javax.swing.GroupLayout(Personalia_JPanel3);
        Personalia_JPanel3.setLayout(Personalia_JPanel3Layout);
        Personalia_JPanel3Layout.setHorizontalGroup(
            Personalia_JPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Personalia_JPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(Personalia_JPanel3Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(Personalia_JPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel43)
                            .addComponent(jLabel41))
                        .addGap(242, 242, 242))
                    .addGroup(Personalia_JPanel3Layout.createSequentialGroup()
                        .addGroup(Personalia_JPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField_Activity)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE))
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        Personalia_JPanel3Layout.setVerticalGroup(
            Personalia_JPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel41)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jLabel43)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Personalia_JPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(2, 2, 2))
            .addComponent(jPanel49, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jPanel49, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                    .addComponent(Personalia_JPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane3.addTab("Activiteit", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-banner-tracks.png")), jPanel8); // NOI18N

        jPanel50.setBackground(new java.awt.Color(204, 204, 204));

        jButton41.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Full-Trash-icon.png"))); // NOI18N
        jButton41.setText("Verwijderen");
        jButton41.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton41ActionPerformed(evt);
            }
        });

        jButton_save_Activityrooster.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Devices-media-floppy-icon.png"))); // NOI18N
        jButton_save_Activityrooster.setText("Opslaan");
        jButton_save_Activityrooster.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_save_Activityrooster.setInheritsPopupMenu(true);
        jButton_save_Activityrooster.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_save_ActivityroosterActionPerformed(evt);
            }
        });

        jButton_add_activityrooster.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/add-1-icon.png"))); // NOI18N
        jButton_add_activityrooster.setText("Nieuwe");
        jButton_add_activityrooster.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jButton_add_activityrooster.setInheritsPopupMenu(true);
        jButton_add_activityrooster.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_add_activityroosterActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel50Layout = new javax.swing.GroupLayout(jPanel50);
        jPanel50.setLayout(jPanel50Layout);
        jPanel50Layout.setHorizontalGroup(
            jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel50Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton_add_activityrooster)
                .addGap(18, 18, 18)
                .addComponent(jButton_save_Activityrooster)
                .addGap(18, 18, 18)
                .addComponent(jButton41)
                .addGap(20, 20, 20))
        );
        jPanel50Layout.setVerticalGroup(
            jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel50Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel50Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton41)
                    .addComponent(jButton_save_Activityrooster)
                    .addComponent(jButton_add_activityrooster))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTable_Activiteitrooster.setAutoCreateRowSorter(true);
        jTable_Activiteitrooster.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_Activiteitrooster.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_ActiviteitroosterMouseClicked(evt);
            }
        });
        jScrollPane12.setViewportView(jTable_Activiteitrooster);

        Personalia_JPanel7.setBackground(new java.awt.Color(204, 255, 204));
        Personalia_JPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(null, "Personalia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 102, 153)))); // NOI18N

        jLabel47.setText("studio");

        jLabel57.setText("Activiteit naam");

        jLabel58.setText("Dag");

        jComboBox_Studio.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een studio" }));

        jComboBox_Vestiging.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een vestigings" }));

        jLabel59.setText("Vestiging ");

        jComboBox_dag_Activity.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een dag" }));

        jComboBox_Activity.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een activiteit" }));
        jComboBox_Activity.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jComboBox_ActivityMouseClicked(evt);
            }
        });

        jLabel60.setText("Begingtijd");

        jLabel61.setText("Eindtijd");

        jLabel62.setForeground(new java.awt.Color(0, 51, 153));
        jLabel62.setText("voorbeeld: 08:30");

        jLabel63.setBackground(new java.awt.Color(0, 51, 204));
        jLabel63.setForeground(new java.awt.Color(0, 51, 204));
        jLabel63.setText("voorbeeld: 09:30");

        jLabel11.setText("Begindatum");

        jLabel14.setText("Einddatum");

        javax.swing.GroupLayout Personalia_JPanel7Layout = new javax.swing.GroupLayout(Personalia_JPanel7);
        Personalia_JPanel7.setLayout(Personalia_JPanel7Layout);
        Personalia_JPanel7Layout.setHorizontalGroup(
            Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, Personalia_JPanel7Layout.createSequentialGroup()
                        .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel59)
                            .addComponent(jLabel47)
                            .addComponent(jLabel58)
                            .addComponent(jLabel60)
                            .addComponent(jLabel61)
                            .addComponent(jLabel11))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jXDatePicker_Begindatun_Activity, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox_Vestiging, 0, 192, Short.MAX_VALUE)
                            .addComponent(jComboBox_Studio, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox_dag_Activity, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(Personalia_JPanel7Layout.createSequentialGroup()
                                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jTextField_Tijd, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextField_endtijd, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel63)
                                    .addComponent(jLabel62)))))
                    .addGroup(Personalia_JPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jXDatePicker_Einddatun_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(Personalia_JPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel57)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jComboBox_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        Personalia_JPanel7Layout.setVerticalGroup(
            Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Personalia_JPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel57)
                    .addComponent(jComboBox_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox_Vestiging, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel59))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox_Studio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel47))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox_dag_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel58))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_Tijd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel62)
                    .addComponent(jLabel60))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_endtijd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel63)
                    .addComponent(jLabel61))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXDatePicker_Begindatun_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(Personalia_JPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXDatePicker_Einddatun_Activity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addContainerGap(54, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Personalia_JPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(jPanel50, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(jPanel50, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(Personalia_JPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        jTabbedPane3.addTab("Activiteitrooster", new javax.swing.ImageIcon(getClass().getResource("/images/size32/calendar-icon.png")), jPanel7); // NOI18N

        jTabbedPane1.addTab("Activiteit", new javax.swing.ImageIcon(getClass().getResource("/images/icon-48-banner-tracks.png")), jTabbedPane3); // NOI18N

        jLabel10.setText("Jaar");

        jComboBox_jaar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een jaar", "2012", "2013", " " }));

        jLabel16.setText("Maand");

        jComboBox_maand.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecteer een maand", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));

        jButton_csv.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/invoice-icon.png"))); // NOI18N
        jButton_csv.setText("Genereer csv");
        jButton_csv.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_csvActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGap(105, 105, 105)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel16)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton_csv, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboBox_maand, 0, 173, Short.MAX_VALUE)
                    .addComponent(jComboBox_jaar, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(446, 446, 446))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(71, 71, 71)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox_jaar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jComboBox_maand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(39, 39, 39)
                .addComponent(jButton_csv)
                .addContainerGap(248, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Genereer csv", new javax.swing.ImageIcon(getClass().getResource("/images/size32/invoice-icon.png")), jPanel3); // NOI18N

        home.setText("Home");
        home.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        home.setFocusCycleRoot(true);
        home.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                homeMouseClicked(evt);
            }
        });

        leden.setText("Leden");
        leden.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        leden.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ledenMouseClicked(evt);
            }
        });

        bar.setText("Bar");
        bar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        bar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                barMouseClicked(evt);
            }
        });

        factuur.setText("Factuur");
        factuur.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        factuur.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                factuurMouseClicked(evt);
            }
        });

        jLabel7.setText("Activiteit");
        jLabel7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel7MouseClicked(evt);
            }
        });

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/size32/Apps-session-logout-icon.png"))); // NOI18N
        jLabel9.setText("logout");
        jLabel9.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel9MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel_menuLayout = new javax.swing.GroupLayout(jPanel_menu);
        jPanel_menu.setLayout(jPanel_menuLayout);
        jPanel_menuLayout.setHorizontalGroup(
            jPanel_menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_menuLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(home)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(leden)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel7)
                .addGap(18, 18, 18)
                .addComponent(factuur)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel9)
                .addContainerGap())
        );
        jPanel_menuLayout.setVerticalGroup(
            jPanel_menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel_menuLayout.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .addGroup(jPanel_menuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(home)
                    .addComponent(leden)
                    .addComponent(bar)
                    .addComponent(factuur)
                    .addComponent(jLabel7))
                .addContainerGap())
            .addGroup(jPanel_menuLayout.createSequentialGroup()
                .addComponent(jLabel9)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel_menu, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jPanel_menu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void homeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeMouseClicked
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new Home(login));
    }//GEN-LAST:event_homeMouseClicked

    private void ledenMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledenMouseClicked
        BarApplication.getInstance().showPanel(new MemberOverview(login));
    }//GEN-LAST:event_ledenMouseClicked

    private void barMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_barMouseClicked

        if (evt != null) {
            BarApplication.getInstance().showPanel(new shopping_bar(login));
        }
    }//GEN-LAST:event_barMouseClicked

    private void factuurMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_factuurMouseClicked
        if (evt != null) {
            BarApplication.getInstance().showPanel(new FactuurOverview(login));
        }
    }//GEN-LAST:event_factuurMouseClicked

    private void jLabel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel7MouseClicked
        // TODO add your handling code here:
        if (evt != null) {

            BarApplication.getInstance().showPanel(new GroupActivityOverview(login));
        }
    }//GEN-LAST:event_jLabel7MouseClicked

    private void jTable_ActiviteitroosterMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_ActiviteitroosterMouseClicked
        // TODO add your handling code here:

        row = jTable_Activiteitrooster.getSelectedRow();
        String Table_click = (jTable_Activiteitrooster.getModel().getValueAt(row, 0).toString());
        ActiviteitroosterId = Integer.parseInt(Table_click);
        //System.out.println("ActiviteitId:" + getGroupActivityRooster ActiviteitId);

        activityRooster = BarApplication.getQueryManager().getGroupActivityRooster(ActiviteitroosterId);

        activity = BarApplication.getQueryManager().getGroupActivity(activityRooster.getActivityID());

        int vestigingID = activityRooster.getBranchID();
        branch = BarApplication.getQueryManager().getVestiging(vestigingID);
        StudioID = activityRooster.getStudioID();
        Branch branchStudio = BarApplication.getQueryManager().getVestigingStudio(StudioID);
        if (vestigingID > 0) {
            // jSpinner_uur.setEditor(new JSpinner.DateEditor(jSpinner_uur, activityRooster.getTijd()));
            jComboBox_Activity.setSelectedItem(activity.getActivityname());
            jComboBox_Vestiging.setSelectedItem(branch.getEstablishment());
            jComboBox_Studio.setSelectedItem(branchStudio.getStudio());
            jComboBox_dag_Activity.setSelectedItem(activityRooster.getDag());
            jTextField_Tijd.setText(activityRooster.getBegintijd().toString());
            jTextField_endtijd.setText(activityRooster.getEindtijd().toString());
            activityRooster.setBegintijd(Time.valueOf(jTextField_Tijd.getText()));
            jXDatePicker_Begindatun_Activity.setDate(activityRooster.getBegindatum());
            jXDatePicker_Einddatun_Activity.setDate(activityRooster.getEinddatum());

        }
    }//GEN-LAST:event_jTable_ActiviteitroosterMouseClicked
//----------------------------------------------------------------------------
    // Methode EmptyActiviteitrooster()is om de avtiveiteitrooster form leeg te maken
//-----------------------------------------------------------------------------

    private void EmptyActiviteitrooster() {
        GroupActivity groupActivity = new GroupActivity();
        groupActivity.setActivityrooster(0);
        jComboBox_Activity.setSelectedIndex(0);
        jComboBox_Vestiging.setSelectedIndex(0);
        jComboBox_Studio.setSelectedIndex(0);
        jComboBox_dag_Activity.setSelectedIndex(0);
        jTextField_Tijd.setText("");
        jTextField_endtijd.setText("");
        jXDatePicker_Begindatun_Activity.setDate(null);
        jXDatePicker_Einddatun_Activity.setDate(null);

        //Refresh the Table after insert or delete or update the data
        tableActiviteitrooster();
    }
    private void jButton_add_activityroosterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_add_activityroosterActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            EmptyActiviteitrooster();

        }
    }//GEN-LAST:event_jButton_add_activityroosterActionPerformed

    private void jButton_save_ActivityroosterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_save_ActivityroosterActionPerformed
        row = jTable_Activiteitrooster.getSelectedRow();
        System.out.println(row);
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get activityRooster ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        if (row >= 0) {
            String Table_click = (jTable_Activiteitrooster.getModel().getValueAt(row, 0).toString());
            ActiviteitroosterId = Integer.parseInt(Table_click);
            activityRooster = BarApplication.getQueryManager().getGroupActivityRooster(ActiviteitroosterId);
            System.out.println("row=" + row);
        } else {
            activityRooster = new GroupActivity();
            branch = new Branch();
            studio = new Studio();
        }
        if (jComboBox_Activity.getSelectedIndex() == 0) {
            JOptionPane.showMessageDialog(this, "Selecteer een Activiteit", "Activiteit", JOptionPane.ERROR_MESSAGE);
        } else {
            if (jComboBox_Vestiging.getSelectedIndex() == 0) {
                JOptionPane.showMessageDialog(this, "Selecteer een vestiging", "vestiging", JOptionPane.ERROR_MESSAGE);
            } else {
                if (jComboBox_Studio.getSelectedIndex() == 0) {
                    JOptionPane.showMessageDialog(this, "Selecteer een vestiging", "Studio", JOptionPane.ERROR_MESSAGE);
                } else {
                    if (jComboBox_dag_Activity.getSelectedIndex() == 0) {
                        JOptionPane.showMessageDialog(this, "Selecteer een dag", "Dag", JOptionPane.ERROR_MESSAGE);
                    } else {
                        if (jTextField_Tijd.getText().trim().equals("")) {
                            JOptionPane.showMessageDialog(this, "Begintijd onbreekt", "begintijd", JOptionPane.ERROR_MESSAGE);
                        } else {
                            if (jTextField_endtijd.getText().trim().equals("")) {
                                JOptionPane.showMessageDialog(this, "Endtijd onbreekt", "Endtijd", JOptionPane.ERROR_MESSAGE);
                            } else {

                                if (jXDatePicker_Begindatun_Activity.getDate() == null) {
                                    JOptionPane.showMessageDialog(this, "Selecteer een Begingdatum", "Begingdatum", JOptionPane.ERROR_MESSAGE);
                                } else {
                                    if (jXDatePicker_Einddatun_Activity.getDate() == null) {
                                        JOptionPane.showMessageDialog(this, "Selecteer een einddatum", "Einddatum", JOptionPane.ERROR_MESSAGE);
                                    } else {
                                        int comparison = jXDatePicker_Einddatun_Activity.getDate().compareTo(jXDatePicker_Begindatun_Activity.getDate());
                                        if (comparison < 0) {
                                            JOptionPane.showMessageDialog(this, "Begindatum is grooter dan einddatum", "Datum", JOptionPane.ERROR_MESSAGE);
                                        } else {


                                            //-------------------------------------------------------------
                                            // Studio
                                            //---------------------------------------------------------------

                                            Studio studioreff = BarApplication.getQueryManager().getStudioID(jComboBox_Studio.getSelectedItem().toString());
                                            StudioID = studioreff.getStudioID();
                                            System.out.println("Studio: " + StudioID);

                                            //----------------------------------------------------------------------
                                            // Vesting
                                            //----------------------------------------------------------------------
                                            Branch vestiging = BarApplication.getQueryManager().getVestigingID(jComboBox_Vestiging.getSelectedItem().toString());
                                            branchId = vestiging.getBranchID();
                                            activity = BarApplication.getQueryManager().getGroupActivityID(jComboBox_Activity.getSelectedItem().toString());
                                            activiteit = activity.getActivityID();

                                            //----------------------------------------------------------------------
                                            // De gegevens voor insert en update te doen
                                            //----------------------------------------------------------------------
                                            activityRooster.setActivityID(activiteit);
                                            activityRooster.setBranchID(branchId);
                                            activityRooster.setStudioID(StudioID);
                                            activityRooster.setDag(jComboBox_dag_Activity.getSelectedItem().toString());
                                            activityRooster.setBegintijd(Time.valueOf(jTextField_Tijd.getText().toString()));
                                            activityRooster.setEindtijd(Time.valueOf(jTextField_endtijd.getText().toString()));
                                            activityRooster.setBegindatum(jXDatePicker_Begindatun_Activity.getDate());
                                            activityRooster.setEinddatum(jXDatePicker_Einddatun_Activity.getDate());


                                            //----------------------------------------------------------------------
                                            // kijk of de Activiteit bestaat all in de database via naam
                                            //----------------------------------------------------------------------

                                            //----------------------------------------------------------------------
                                            // check if field is empty
                                            //----------------------------------------------------------------------


                                            //-------------------------------------------------------------------
                                            //Doe een INSERT wanneer de activiteit naam bestaat in de database
                                            //en row in de activiteit tabel is niet geselecteerd.
                                            //---------------------------------------------------------------------
                                                int roostervergelijke = BarApplication.getQueryManager().getRoostervergelijkeActiviteit(branchId, StudioID, jXDatePicker_Begindatun_Activity.getDate(), jXDatePicker_Einddatun_Activity.getDate(), jComboBox_dag_Activity.getSelectedItem().toString(), jTextField_Tijd.getText(), jTextField_endtijd.getText());
                                                    if (roostervergelijke > 0) {
                                                        JOptionPane.showMessageDialog(this, "Locatie bezet", "locatie", JOptionPane.ERROR_MESSAGE);
                                                    } else {


                                            
                                            if (row < 0) {

                                                activityRooster.insertRooster();

                                                //Refresh the Table after insert delete or update the data
                                                //tableActiviteitrooster();
                                                EmptyActiviteitrooster();


                                                //------------------------------------------------------------------------------
                                                //Doe een UPDATE wanneer de activiteit naam bestaat in de database
                                                //en row in de activiteit tabel is geselecteerd.
                                                //------------------------------------------------------------------------------
                                            } else if (row >= 0) {

                                                activiteit = activity.getActivityID();
                                                activity.setActivityID(activiteit);


                                                activityRooster.updateRooster();

                                                //Refresh the Table after insert delete or update the data
                                                //tableActiviteitrooster();
                                                EmptyActiviteitrooster();


                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                }
            }
        }
        }
    }//GEN-LAST:event_jButton_save_ActivityroosterActionPerformed

    private void jTable_ActiviteitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_ActiviteitMouseClicked
        row = jTable_Activiteit.getSelectedRow();
        String Table_click = (jTable_Activiteit.getModel().getValueAt(row, 0).toString());
        ActiviteitId = Integer.parseInt(Table_click);
        activity = BarApplication.getQueryManager().getGroupActivity(ActiviteitId);
        jTextField_Activity.setText(activity.getActivityname());
        jTextArea_Activity.setText(activity.getDescr());
    }//GEN-LAST:event_jTable_ActiviteitMouseClicked
//-----------------------------------------------------------------------------
    //
//-----------------------------------------------------------------------------

    private void EmptyActiviteitField() {
        jTextField_Activity.setText("");
        jTextArea_Activity.setText("");
        //Refresh the Table after insert or delete or update the data
        tableActiviteit();
    }
//-----------------------------------------------------------------------------
    //
//-----------------------------------------------------------------------------
    private void jButton_add_activityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_add_activityActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            EmptyActiviteitField();

        }
    }//GEN-LAST:event_jButton_add_activityActionPerformed

    private void jButton_save_ActivityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_save_ActivityActionPerformed
        // TODO add your handling code here:

        row = jTable_Activiteit.getSelectedRow();
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get activityRooster ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        if (row >= 0) {
            String Table_click = (jTable_Activiteit.getModel().getValueAt(row, 0).toString());
            ActiviteitId = Integer.parseInt(Table_click);
            activity = BarApplication.getQueryManager().getGroupActivity(ActiviteitId);

        } else {
            activity = new GroupActivity();

        }

        //----------------------------------------------------------------------
        // De gegevens voor insert en update te doen
        //----------------------------------------------------------------------
        activity.setActivityname(jTextField_Activity.getText());
        activity.setDescr(jTextArea_Activity.getText());

        //-------------------------------------------------------------------
        //Doe een INSERT wanneer de activiteit naam bestaat niet in de database
        //en row in de activiteit tabel is niet geselecteerd.
        //---------------------------------------------------------------------
        if (row < 0) {


            activity.insert();

            //Refresh the Table after insert delete or update the data
            tableActiviteit();
            EmptyActiviteitField();

            //------------------------------------------------------------------------------
            //Doe een UPDATE wanneer de activiteit naam bestaat in de database
            //en row in de activiteit tabel is geselecteerd.
            //------------------------------------------------------------------------------
        } else if (row >= 0) {

            activiteit = activity.getActivityID();
            activity.setActivityID(activiteit);


            activity.update();

            //Refresh the Table after insert delete or update the data
            tableActiviteit();
            EmptyActiviteitField();



        }

        //----------------------------------------------------------------------
        //CONTROLEREN OF FIELD IS EMPTY
        //----------------------------------------------------------------------

    }//GEN-LAST:event_jButton_save_ActivityActionPerformed

    private void jComboBox_cursusnaamItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox_cursusnaamItemStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox_cursusnaamItemStateChanged

    private void jTable_cursusrooterMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_cursusrooterMouseClicked

        row = jTable_cursusrooter.getSelectedRow();
        String Table_click = (jTable_cursusrooter.getModel().getValueAt(row, 0).toString());
        cursusroosterId = Integer.parseInt(Table_click);
        //System.out.println("ActiviteitId:" + getGroupActivityRooster ActiviteitId);

        cursusrooster = BarApplication.getQueryManager().getCususRooster(cursusroosterId);

        cursus = BarApplication.getQueryManager().getCourse(cursusrooster.getCursusnummer());
        cursusnaam = cursus.getCursusnaam();
        int vestigingID = cursusrooster.getBranchID();
        branch = BarApplication.getQueryManager().getVestiging(vestigingID);
        StudioID = cursusrooster.getStudioID();
        Branch branchStudio = BarApplication.getQueryManager().getVestigingStudio(StudioID);
        if (vestigingID > 0) {

            jComboBox_cursusnaam.setSelectedItem(cursusnaam);
            jComboBox_vestiging_curusus.setSelectedItem(branch.getEstablishment());
            jComboBox_Studio_cursus.setSelectedItem(branchStudio.getStudio());
            jXDatePicker_Begingdatum.setDate(cursusrooster.getBigingdate());
            jXDatePicker_eniddatum.setDate(cursusrooster.getEinddate());
            jTextField_begintijd.setText(cursusrooster.getVan().toString());
            jTextField_eindtijd.setText(cursusrooster.getTot().toString());
            jComboBox_dagen.setSelectedItem(cursusrooster.getDag());
            jTextField_MaxAantal.setText(Integer.toString(cursusrooster.getMaxaantal()));

        }

    }//GEN-LAST:event_jTable_cursusrooterMouseClicked

    private void jButton_SaveCursus2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SaveCursus2ActionPerformed
        // TODO add your handling code here:
        row = jTable_cursusrooter.getSelectedRow();
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get activityRooster ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        if (row >= 0) {
            String Table_click = (jTable_cursusrooter.getModel().getValueAt(row, 0).toString());
            cursusroosterId = Integer.parseInt(Table_click);
            cursusrooster = BarApplication.getQueryManager().getCususRooster(cursusroosterId);

        } else {
            cursusrooster = new Course();
            branch = new Branch();
            studio = new Studio();
        }

        //----------------------------------------------------------------------
        // check if field is empty
        //----------------------------------------------------------------------
        if (jComboBox_cursusnaam.getSelectedItem().equals(" ")) {
            JOptionPane.showMessageDialog(this, "Cursusnaam onbreekt", "Cursusnaam", JOptionPane.ERROR_MESSAGE);
        } else {
            if (jComboBox_vestiging_curusus.getSelectedIndex() == 0) {
                JOptionPane.showMessageDialog(this, "Selecteer een vestiging", "vestiging", JOptionPane.ERROR_MESSAGE);
            } else {
                if (jComboBox_Studio_cursus.getSelectedIndex() == 0) {
                    JOptionPane.showMessageDialog(this, "Selecteer een vestiging", "vestiging", JOptionPane.ERROR_MESSAGE);
                } else {
                    if (jXDatePicker_Begingdatum.getDate() == null) {
                        JOptionPane.showMessageDialog(this, "Selecteer een Begingdatum", "Begingdatum", JOptionPane.ERROR_MESSAGE);
                    } else {
                        if (jXDatePicker_eniddatum.getDate() == null) {
                            JOptionPane.showMessageDialog(this, "Selecteer een einddatum", "einddatum", JOptionPane.ERROR_MESSAGE);
                        } else {
                            int comparison = jXDatePicker_eniddatum.getDate().compareTo(jXDatePicker_Begingdatum.getDate());
                            if (comparison < 0) {
                                JOptionPane.showMessageDialog(this, "Begindatum is grooter dan einddatum", "Datum", JOptionPane.ERROR_MESSAGE);
                            } else {

                                if (jComboBox_dagen.getSelectedIndex() == 0) {
                                    JOptionPane.showMessageDialog(this, "Selecteer een dag", "Dag", JOptionPane.ERROR_MESSAGE);
                                } else {
                                    if (jTextField_begintijd.getText().trim().equals("")) {
                                        JOptionPane.showMessageDialog(this, "Begintijd onbreekt", "begintijd", JOptionPane.ERROR_MESSAGE);
                                    } else {
                                        if (jTextField_eindtijd.getText().trim().equals("")) {
                                            JOptionPane.showMessageDialog(this, "Begintijd onbreekt", "Eindtijd", JOptionPane.ERROR_MESSAGE);
                                        } else {
                                            int comparisonTime = jTextField_eindtijd.getText().compareTo(jTextField_begintijd.getText());
                                            if (comparison < 0) {
                                                JOptionPane.showMessageDialog(this, "Eindtijd is grooter dan Begintijd", "Datum", JOptionPane.ERROR_MESSAGE);
                                            } else {
                                                if (jTextField_MaxAantal.getText().trim().equals("")) {
                                                    JOptionPane.showMessageDialog(this, "MaxAantal onbreekt", "MaxAantal", JOptionPane.ERROR_MESSAGE);
                                                } else {


                                                    //-------------------------------------------------------------
                                                    // Studio
                                                    //---------------------------------------------------------------

                                                    Studio studioreff = BarApplication.getQueryManager().getStudioID(jComboBox_Studio_cursus.getSelectedItem().toString());
                                                    StudioID = studioreff.getStudioID();

                                                    //----------------------------------------------------------------------
                                                    // Vesting
                                                    //----------------------------------------------------------------------
                                                    Branch vestiging = BarApplication.getQueryManager().getVestigingID(jComboBox_vestiging_curusus.getSelectedItem().toString());
                                                    branchId = vestiging.getBranchID();
                                                    cursus = BarApplication.getQueryManager().getCoursename(jComboBox_cursusnaam.getSelectedItem().toString());
                                                    System.out.println(jComboBox_cursusnaam.getSelectedItem());
                                                    cursusId = cursus.getCursusnummer();
                                                    //----------------------------------------------------------------------
                                                    // De gegevens voor insert en update te doen
                                                    //----------------------------------------------------------------------
                                                    cursusrooster.setCursusnummer(cursusId);
                                                    cursusrooster.setBranchID(branchId);
                                                    cursusrooster.setStudioID(StudioID);
                                                    cursusrooster.setBigingdate(jXDatePicker_Begingdatum.getDate());
                                                    cursusrooster.setEinddate(jXDatePicker_eniddatum.getDate());
                                                    cursusrooster.setVan(Time.valueOf(jTextField_begintijd.getText()));
                                                    cursusrooster.setTot(Time.valueOf(jTextField_eindtijd.getText()));
                                                    cursusrooster.setDag(jComboBox_dagen.getSelectedItem().toString());
                                                    cursusrooster.setMaxaantal(Integer.parseInt(jTextField_MaxAantal.getText()));

                                                    int roostervergelijke = BarApplication.getQueryManager().getRoostervergelijke(branchId, StudioID, jXDatePicker_Begingdatum.getDate(), jXDatePicker_eniddatum.getDate(), jComboBox_dagen.getSelectedItem().toString(), jTextField_begintijd.getText(), jTextField_eindtijd.getText());
                                                    if (roostervergelijke > 0) {
                                                        JOptionPane.showMessageDialog(this, "Locatie bezet", "locatie", JOptionPane.ERROR_MESSAGE);
                                                    } else {


                                                        //-------------------------------------------------------------------
                                                        //Doe een INSERT wanneer de cursus naam bestaat in de database
                                                        //en row in de cursus tabel is niet geselecteerd.
                                                        //---------------------------------------------------------------------
                                                        if (row < 0) {

                                                            cursusrooster.insertRooster();
                                                            //BarApplication.getQueryManager().addCursusToRooster(course);

                                                            //Refresh the Table after insert delete or update the data
                                                            //tableCususrooster();
                                                            EmptyCususroosterField();

                                                            //------------------------------------------------------------------------------
                                                            //Doe een UPDATE wanneer de cursus naam bestaat in de database
                                                            //en row in de cursus tabel is geselecteerd.
                                                            //------------------------------------------------------------------------------
                                                        } else if (row >= 0) {

                                                            cursusrooster.updaterooster();
                                                            EmptyCususroosterField();

                                                            //Refresh the Table after insert delete or update the data
                                                            // tableCususrooster();
                                                            //EmptyCususroosterField();
                                                            // jComboBox_Activity.repaint();
                                                        }
                                                    }
                                                }
                                            }
                                        }

                                    }
                                }

                            }
                        }
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton_SaveCursus2ActionPerformed
    //----------------------------------------------------------------------------
    //
    //------------------------------------------------------------------------------

    private void EmptyCususroosterField() {

        jComboBox_cursusnaam.setSelectedIndex(0);
        jComboBox_vestiging_curusus.setSelectedIndex(0);
        jComboBox_Studio_cursus.setSelectedIndex(0);
        jComboBox_dagen.setSelectedIndex(0);
        jXDatePicker_Begingdatum.setDate(null);
        jXDatePicker_eniddatum.setDate(null);
        jTextField_begintijd.setText(dateFormat.format(cal.getTime()));
        jTextField_eindtijd.setText(dateFormat.format(cal.getTime()));
        jTextField_MaxAantal.setText("0");

        //------------------------------------------------------------------------------
        //
        //------------------------------------------------------------------------------
        tableCususrooster();

    }
    //----------------------------------------------------------------------------
    //
    //------------------------------------------------------------------------------
    private void jButton30ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton30ActionPerformed
        // TODO add your handling code here:
        EmptyCususroosterField();
    }//GEN-LAST:event_jButton30ActionPerformed

    private void jTable_cursus1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_cursus1MouseClicked

        row = jTable_cursus1.getSelectedRow();
        String Table_click = (jTable_cursus1.getModel().getValueAt(row, 0).toString());
        cursusId = Integer.parseInt(Table_click);
        //System.out.println("ActiviteitId:" + getGroupActivityRooster ActiviteitId);

        cursus = BarApplication.getQueryManager().getCourse(cursusId);

        jTextField_cursusnaam.setText(cursus.getCursusnaam());
        jTextField_Cursus_Prijs.setText(Double.toString(cursus.getPrijs()));
        jTextArea_cursus.setText(cursus.getDescr());

    }//GEN-LAST:event_jTable_cursus1MouseClicked

    private void jButton_SaveCursus1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SaveCursus1ActionPerformed

        row = jTable_cursus1.getSelectedRow();
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get Product ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        if (row >= 0) {

            String Table_click = (jTable_cursus1.getModel().getValueAt(row, 0).toString());
            productId = Integer.parseInt(Table_click);
            product = BarApplication.getQueryManager().getProduct(productId);

        } else {
            product = new Product();

        }


        categotyId = 8;

        product.setCategorieId(categotyId);
        product.setName(jTextField_cursusnaam.getText());
        product.setPrice(Double.valueOf(jTextField_Cursus_Prijs.getText()));
        product.setDescription(jTextArea_cursus.getText());

        //-------------------------------------------------------------------
        //Doe een INSERT wanneer de Product naam niet bestaat in de database
        //en row in de product tabel is niet geselecteerd.
        //-----------------------------------------------------------------------------

        if (row < 0) {

            try {
                product.insert();
                JOptionPane.showMessageDialog(this, "Succesvol toegevoegd!",
                        "Succesvol", JOptionPane.INFORMATION_MESSAGE);

                //Refresh the Table after insert delete or update the data
                Refreshcursus();


            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "Sorry! probeer nogmaals",
                        "Error!", JOptionPane.ERROR_MESSAGE);

            }
            //------------------------------------------------------------------------------
            //Doe een UPDATE wanneer de Product naam bestaat in de database
            //en row in de table Product is geselecteerd.
            //------------------------------------------------------------------------------
        } else if (row >= 0) {

            try {
                product.update();
                JOptionPane.showMessageDialog(this, "Succesvol gewijzigd!",
                        "Succesvol", JOptionPane.INFORMATION_MESSAGE);

                //Refresh the Table after insert delete or update the data
                Refreshcursus();


            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, "De wijziging is mislukt! probeer nogmaals",
                        "Error!", JOptionPane.ERROR_MESSAGE);
            }
        }
    }//GEN-LAST:event_jButton_SaveCursus1ActionPerformed
    private void Refreshcursus() {

        jTextField_cursusnaam.setText("");
        jTextField_Cursus_Prijs.setText("0.00");
        jTextArea_cursus.setText("");

        tableCusus();

    }
    private void jButton27ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton27ActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            Refreshcursus();
        }
    }//GEN-LAST:event_jButton27ActionPerformed

    //-------------------------------------------------------------------------
    // BEGING CATEGORY/////////////////////////////////////////////////////
    //-------------------------------------------------------------------------
    private void jTable_categorieMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_categorieMouseClicked
        // TODO add your handling code here:
        row = jTable_categorie.getSelectedRow();
        String Table_click = (jTable_categorie.getModel().getValueAt(row, 0).toString());
        categotyId = Integer.parseInt(Table_click);
        categorie = BarApplication.getQueryManager().getCategorie(categotyId);
        MaincategotyId = categorie.getMainCategoryId();
        Maincategorie = BarApplication.getQueryManager().getMainCategorys(MaincategotyId);
        jTextField_Categorie.setText(categorie.getName());
        System.out.println(Maincategorie.getMaincategoryname());
        jComboBox_categorie.setSelectedItem(Maincategorie.getMaincategoryname());
        jTextArea_categorie.setText(categorie.getDescription());
    }//GEN-LAST:event_jTable_categorieMouseClicked
    private void RefreshCategorie() {
        jTextField_Categorie.setText("");
        jComboBox_categorie.setSelectedIndex(0);
        jTextArea_categorie.setText("");
        tableCategorie();
    }
    private void jButton28ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton28ActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            RefreshCategorie();
        }

    }//GEN-LAST:event_jButton28ActionPerformed

    private void jButton_CategorieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_CategorieActionPerformed

        row = jTable_categorie.getSelectedRow();
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get Product ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        if (row >= 0) {

            String Table_click = (jTable_categorie.getModel().getValueAt(row, 0).toString());
            categotyId = Integer.parseInt(Table_click);
            categorie = BarApplication.getQueryManager().getCategorie(categotyId);

        } else {
            categorie = new Category();
        }

        Maincategorie = BarApplication.getQueryManager().NamegetMainCategoryId(jComboBox_categorie.getSelectedItem().toString());
        MaincategotyId = Maincategorie.getCategoryId();

        categorie.setName(jTextField_Categorie.getText());
        categorie.setMaincategorie_id(MaincategotyId);
        System.out.println("id:" + MaincategotyId);
        categorie.setDescription(jTextArea_categorie.getText());

        //------------ -------------------------------------------------------
        //Doe een INSERT wanneer de categorie naam niet bestaat in de database
        //en row in de product tabel is niet geselecteerd.
        //-----------------------------------------------------------------------------

        if (row <= 0) {
            System.out.println("ik ben binnen");

            categorie.insert();

            //Refresh the Table after insert delete or update the data
            RefreshCategorie();

            //------------------------------------------------------------------------------
            //Doe een UPDATE wanneer de Product naam bestaat in de database
            //en row in de table Product is geselecteerd.
            //------------------------------------------------------------------------------
        } else if (row >= 0) {

            categorie.update();

            //Refresh the Table after insert delete or update the data
            RefreshCategorie();

        }
    }//GEN-LAST:event_jButton_CategorieActionPerformed

    private void RefreshProduct() {
        jTextField_Prodductnaam.setText("");
        prijs_TF.setText(String.valueOf(""));
        jComboBox_ProductenCategorie.setSelectedIndex(0);
        jTextArea_productBeschr.setText("");

        //Refresh the Table after insert or delete or update the data
        tableProduct();
    }
    private void jButton_newProductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_newProductActionPerformed
        if (evt != null) {
            RefreshProduct();
        }
    }//GEN-LAST:event_jButton_newProductActionPerformed

    private void jButton_SaveProductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SaveProductActionPerformed

        row = jTable_Product.getSelectedRow();
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get Product ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        if (row >= 0) {

            String Table_click = (jTable_Product.getModel().getValueAt(row, 0).toString());
            productId = Integer.parseInt(Table_click);
            product = BarApplication.getQueryManager().getProduct(productId);

        } else {
            product = new Product();
            categorie = new Category();
        }

        categorie = BarApplication.getQueryManager().getCategoryIdnaam(jComboBox_ProductenCategorie.getSelectedItem().toString());
        categotyId = categorie.getCategoryId();

        product.setCategorieId(categotyId);
        product.setName(jTextField_Prodductnaam.getText());
        product.setPrice(Double.valueOf(prijs_TF.getText()));
        product.setDescription(jTextArea_productBeschr.getText());

        //-------------------------------------------------------------------
        //Doe een INSERT wanneer de Product naam niet bestaat in de database
        //en row in de product tabel is niet geselecteerd.
        //-----------------------------------------------------------------------------

        if (row < 0) {

            product.insert();

            //Refresh the Table after insert delete or update the data
            //tableProduct();
            RefreshProduct();

            //------------------------------------------------------------------------------
            //Doe een UPDATE wanneer de Product naam bestaat in de database
            //en row in de table Product is geselecteerd.
            //------------------------------------------------------------------------------
        } else if (row >= 0) {

            product.update();
            //Refresh the Table after insert delete or update the data
            //tableProduct();
            RefreshProduct();

        }
    }//GEN-LAST:event_jButton_SaveProductActionPerformed

    private void jTable_StaffMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_StaffMouseClicked

        try {
            row = jTable_Staff.getSelectedRow();
            String Table_click = (jTable_Staff.getModel().getValueAt(row, 0).toString());
            medewerkerId = Integer.parseInt(Table_click);

            medewerker = BarApplication.getQueryManager().getMedewerker(medewerkerId);

            int vestigingID = medewerker.getBranch();
            branch = BarApplication.getQueryManager().getVestiging(vestigingID);

            if (medewerkerId > 0) {

                DateFormat df = DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.getDefault());
                //jTextField_medewerkerId.setEditable(false);
                jTextField_medewerkerId.setText(Table_click);
                jTextField_voornaam.setText(medewerker.getFirstname());
                jTextField_Tussenvoegsel.setText(medewerker.getMiddlename());
                jTextField_Achternaam.setText(medewerker.getLastname());
                jTextField_email.setText(medewerker.getEmail());
                jTextField_wachtwoord.setText(medewerker.getPassword());
                //geboortedatum
                //Vullen combobox
                //Calendar calendar = Calendar.getInstance();
                //SimpleDateFormat dateFormatJaar = new SimpleDateFormat("yyyy");
                SimpleDateFormat dateFormatMaand = new SimpleDateFormat("MM");
                SimpleDateFormat dateFormatDag = new SimpleDateFormat("dd");
                int jaarGeboorteDatumLid;
                int maandGeboorteDatumLid;
                int dagGeboorteDatumLid;
                DateFormat formatter;
                Date geboorteDatum;
                formatter = new SimpleDateFormat("yyyy-MM-dd");
                geboorteDatum = (Date) formatter.parse(medewerker.getBirthday());
                jaarGeboorteDatumLid = Integer.parseInt(dateFormatJaar.format(geboorteDatum));
                maandGeboorteDatumLid = Integer.parseInt(dateFormatMaand.format(geboorteDatum));
                dagGeboorteDatumLid = Integer.parseInt(dateFormatDag.format(geboorteDatum));

                if (medewerker.getGender().equals("man")) {
                    jCheckBox_Man.setSelected(true);
                    jCheckBox_Vrouw.setSelected(false);
                } else if (medewerker.getGender().equals("vrouw")) {
                    jCheckBox_Vrouw.setSelected(true);
                    jCheckBox_Man.setSelected(false);
                }

                jComboBox_Jaar.setSelectedItem(Integer.toString(jaarGeboorteDatumLid));
                jComboBox_Maand.setSelectedItem(Integer.toString(maandGeboorteDatumLid));
                jComboBox_Dag.setSelectedItem(Integer.toString(dagGeboorteDatumLid));

                jTextField_Mobilenummer.setText(medewerker.getMobilePhone());
                if (branch.getEstablishment().equals("Alkmaar")) {
                    jCheckBox_Alkamaar.setSelected(true);
                    jCheckBox_Haarlem.setSelected(false);
                    jCheckBox_Purmerend.setSelected(false);

                } else if (branch.getEstablishment().equals("Haarlem")) {
                    jCheckBox_Haarlem.setSelected(true);

                    jCheckBox_Alkamaar.setSelected(false);
                    jCheckBox_Purmerend.setSelected(false);
                } else if (branch.getEstablishment().equals("Purmerend")) {
                    jCheckBox_Purmerend.setSelected(true);
                    jCheckBox_Alkamaar.setSelected(false);
                    jCheckBox_Haarlem.setSelected(false);
                } else {
                    //do nothing
                }
                // via de row en de column waarde wordt de funtienaam uit de tabel staff gehald
                functionId = medewerker.getFunctionId();
                medewerker = BarApplication.getQueryManager().getfunctie(functionId);
                jComboBox_functie.setSelectedItem(medewerker.getFuntionname());

            }

        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex);
        }
    }//GEN-LAST:event_jTable_StaffMouseClicked

    private void jTextField_voornaamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_voornaamActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_voornaamActionPerformed

    private void jCheckBox_ManActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox_ManActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            jCheckBox_Vrouw.setSelected(false);
        }
        // jCheckBox_Man.setSelected(false);
    }//GEN-LAST:event_jCheckBox_ManActionPerformed

    private void jTextField_TussenvoegselActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_TussenvoegselActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_TussenvoegselActionPerformed

    private void jCheckBox_VrouwActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox_VrouwActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            jCheckBox_Man.setSelected(false);
        }
    }//GEN-LAST:event_jCheckBox_VrouwActionPerformed

    private void jCheckBox_AlkamaarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox_AlkamaarActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            jCheckBox_Alkamaar.setSelected(true);
            jCheckBox_Purmerend.setSelected(false);
            jCheckBox_Haarlem.setSelected(false);

        }
    }//GEN-LAST:event_jCheckBox_AlkamaarActionPerformed

    private void jCheckBox_PurmerendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox_PurmerendActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            jCheckBox_Purmerend.setSelected(true);
            jCheckBox_Haarlem.setSelected(false);
            jCheckBox_Alkamaar.setSelected(false);

        }
    }//GEN-LAST:event_jCheckBox_PurmerendActionPerformed

    private void jCheckBox_HaarlemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox_HaarlemActionPerformed
        // TODO add your handling code here:
        if (evt != null) {
            jCheckBox_Haarlem.setSelected(true);
            jCheckBox_Alkamaar.setSelected(false);
            jCheckBox_Purmerend.setSelected(false);
        }
    }//GEN-LAST:event_jCheckBox_HaarlemActionPerformed
    private void EmptyMedewerkerform() {

        jTextField_medewerkerId.setText("");
        jTextField_voornaam.setText("");
        jTextField_Tussenvoegsel.setText("");
        jTextField_Achternaam.setText("");
        jTextField_email.setText("");
        jTextField_wachtwoord.setText("");
        jTextField_Mobilenummer.setText("");
        jComboBox_functie.setSelectedIndex(0);
        jCheckBox_Alkamaar.setSelected(false);
        jCheckBox_Haarlem.setSelected(false);
        jCheckBox_Purmerend.setSelected(false);
        tableMedewerker();
    }
    private void jButton25ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton25ActionPerformed
        if (evt != null) {
            EmptyMedewerkerform();
        }
    }//GEN-LAST:event_jButton25ActionPerformed

    private void jButton_SaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SaveActionPerformed
        row = jTable_Staff.getSelectedRow();
        if (jCheckBox_Alkamaar.isSelected()) {

            Branch VestigingID = BarApplication.getQueryManager().getVestigingID("Alkmaar");
            branchId = VestigingID.getBranchID();

        } else {
            if (jCheckBox_Haarlem.isSelected()) {

                Branch VestigingID = BarApplication.getQueryManager().getVestigingID("Haarlem");
                branchId = VestigingID.getBranchID();

            } else {
                if (jCheckBox_Purmerend.isSelected()) {

                    Branch VestigingID = BarApplication.getQueryManager().getVestigingID("Purmerend");
                    branchId = VestigingID.getBranchID();
                } else {
                }
            }
        }
        //System.out.println("id:" +jTextField_medewerkerId.getText());
        if (!"".equals(jTextField_medewerkerId.getText())) {
            medewerkerId = Integer.parseInt(jTextField_medewerkerId.getText());
            medewerker = BarApplication.getQueryManager().getMedewerker(medewerkerId);
        } else {
            medewerker = new Staff();
        }

        functionname = jComboBox_functie.getSelectedItem().toString();
        Staff funtionID = BarApplication.getQueryManager().getfunctieID(functionname);
        functionId = funtionID.getFunctionId();

        //        Branch VestigingID = BarApplication.getQueryManager().getVestigingID("Alkmaar");
        //        branchId = VestigingID.getBranchID();

        //-----------------------------------------------------------------
        // Test
        //------------------------------------------------------------------

        firstName = jTextField_voornaam.getText();
        middleName = jTextField_Tussenvoegsel.getText();
        lastName = jTextField_Achternaam.getText();
        birthday = jComboBox_Jaar.getSelectedItem().toString() + "-" + jComboBox_Maand.getSelectedItem().toString() + "-" + jComboBox_Dag.getSelectedItem().toString();
        mobilePhone = jTextField_Mobilenummer.getText();
        emailAddress = jTextField_email.getText();
        password = jTextField_wachtwoord.getText();
        System.out.println("voornaam: " + firstName);

        gender = null;
        //controleren welke checkbox is geselecteerd
        if (jCheckBox_Man.isSelected()) {
            gender = "man";
        } else if (jCheckBox_Vrouw.isSelected()) {
            gender = "vrouw";
        }

        medewerker.setFirstname(firstName);
        medewerker.setMiddlename(middleName);
        medewerker.setLastname(lastName);
        medewerker.setBirthday(birthday);
        medewerker.setGender(gender);
        medewerker.setMobilePhone(mobilePhone);
        medewerker.setEmail(emailAddress);
        medewerker.setBranch(branchId);
        medewerker.setFunctionId(functionId);
        medewerker.setPassword(password);

        //controleren of het email adressgoed geformereed is
        Validator validator = new model.Validator();
        // boolean valid = emailValidator.validate(emailAddress);

        // Set de waardes van de textfields in het Member object

        //CONTROLEREN OF FIELD IS EMPTY
        if (firstName.equals("")) {

            jTextField_voornaam.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
            JOptionPane.showMessageDialog(this, "First Name is missing", "Last Name", JOptionPane.ERROR_MESSAGE);

        } else {
            if (lastName.equals("")) {
                jTextField_Achternaam.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
                JOptionPane.showMessageDialog(this, "Last Name is missing", "Last Name", JOptionPane.ERROR_MESSAGE);
            } else {
                if (gender == null) {

                    JOptionPane.showMessageDialog(this, "GESLACHT is niet geselecteerd", "Geslacht", JOptionPane.ERROR_MESSAGE);
                } else {
                    if (mobilePhone.equals("")) {

                        jTextField_Mobilenummer.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
                        JOptionPane.showMessageDialog(this, "mobile Phone is missing", "Mobile Phone", JOptionPane.ERROR_MESSAGE);

                    } else {
                        if (!validator.ValidatePhoneNumber(mobilePhone)) {

                            jTextField_Mobilenummer.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
                            JOptionPane.showMessageDialog(this, "Telefoonnummer moet in de vorm: 06-12345678", "Mobiel nummer", JOptionPane.ERROR_MESSAGE);

                        } else {
                            if (emailAddress.equals("")) {

                                jTextField_email.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
                                JOptionPane.showMessageDialog(this, "E-Mail address is missing", "E-Mail addres", JOptionPane.ERROR_MESSAGE);

                            } else {
                                if (!validator.validate(emailAddress)) {

                                    jTextField_email.setBorder(BorderFactory.createMatteBorder(0, 0, 5, 0, Color.PINK));
                                    JOptionPane.showMessageDialog(this, "E-Mail address is invalid", "E-Mail addres", JOptionPane.ERROR_MESSAGE);

                                } else {
                                    if (medewerkerId > 0 && row >= 0) {

                                        medewerker.update();

                                        //Refresh JTable after insert delete or update the data
                                        //tableMedewerker();
                                        EmptyMedewerkerform();
                                    } else {

                                        medewerker.insert();

                                        //Refresh JTable after insert delete or update the data
                                        //tableMedewerker();
                                        EmptyMedewerkerform();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton_SaveActionPerformed

    private void jButton38ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton38ActionPerformed
        // TODO add your handling code here:
        String Table_click = (jTable_Staff.getModel().getValueAt(row, 0).toString());
        medewerkerId = Integer.parseInt(Table_click);
        BarApplication.getQueryManager().getProduct(medewerkerId);
        int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je dit medewerker wil verwijderen", "verwijderen", JOptionPane.YES_NO_OPTION);
        if (WarningMessage == 0) {
            BarApplication.getQueryManager().getProduct(medewerkerId);
            BarApplication.getQueryManager().DeleteRow("medewerker", "medewerkernummer", medewerkerId);
            EmptyMedewerkerform();
        }


    }//GEN-LAST:event_jButton38ActionPerformed

    private void jTable_ActiviteitKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTable_ActiviteitKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTable_ActiviteitKeyPressed

    private void jTable_ActiviteitKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTable_ActiviteitKeyReleased
        // TODO add your handling code here:
        if (evt.getKeyCode() == KeyEvent.VK_DOWN || evt.getKeyCode() == KeyEvent.VK_UP) {
            row = jTable_Activiteit.getSelectedRow();
            String Table_click = (jTable_Activiteit.getModel().getValueAt(row, 0).toString());
            ActiviteitId = Integer.parseInt(Table_click);
            activity = BarApplication.getQueryManager().getGroupActivity(ActiviteitId);
            jTextField_Activity.setText(activity.getActivityname());
            jTextArea_Activity.setText(activity.getDescr());
        }
    }//GEN-LAST:event_jTable_ActiviteitKeyReleased

    private void jTable_ProductMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_ProductMouseClicked
        // TODO add your handling code here:

        row = jTable_Product.getSelectedRow();
        //------------------------------------------------------------------------------
        // check if row is selected if answer is yes Get Product ID else
        //declare an instance of GroupActivity class, branch and studio.
        //------------------------------------------------------------------------------
        String Table_click = (jTable_Product.getModel().getValueAt(row, 0).toString());
        productId = Integer.parseInt(Table_click);
        product = BarApplication.getQueryManager().getProduct(productId);


        categorie = BarApplication.getQueryManager().getCategorie(product.getCategorieId());

        jTextField_Prodductnaam.setText(product.getName());
        prijs_TF.setText(Double.toString(product.getPrice()));
        jComboBox_ProductenCategorie.setSelectedItem(categorie.getName());
        jTextArea_productBeschr.setText(product.getDescription());


    }//GEN-LAST:event_jTable_ProductMouseClicked

    private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
        // TODO add your handling code here:
        row = jTable_Product.getSelectedRow();

        if (row < 0) {
            JOptionPane.showMessageDialog(this, "Product is niet geselecteerd", "E-Mail addres", JOptionPane.ERROR_MESSAGE);

        } else {
            String Table_click = (jTable_Product.getModel().getValueAt(row, 0).toString());
            productId = Integer.parseInt(Table_click);
            product = BarApplication.getQueryManager().getProduct(productId);
            int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je dit product wil verwijderen", "verwijderen", JOptionPane.YES_NO_OPTION);
            if (WarningMessage == 0) {
                product = BarApplication.getQueryManager().getProduct(productId);
                BarApplication.getQueryManager().DeleteRow("product", "productnummer", productId);
                //tableProduct();
                RefreshProduct();
            }
        }
    }//GEN-LAST:event_jButton21ActionPerformed

    private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel9MouseClicked
        // TODO add your handling code here:
        BarApplication.getInstance().showPanel(new LoginScreen());
    }//GEN-LAST:event_jLabel9MouseClicked

    private void jButton35ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton35ActionPerformed
        // TODO add your handling code here:
        row = jTable_categorie.getSelectedRow();
        if (row < 0) {
            JOptionPane.showMessageDialog(this, "Categorie is niet geselecteerd", "E-Mail addres", JOptionPane.ERROR_MESSAGE);

        } else {
            int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je dit categrorie wil verwijderen", "verwijderen", JOptionPane.YES_NO_OPTION);
            if (WarningMessage == 0) {
                String Table_click = (jTable_categorie.getModel().getValueAt(row, 0).toString());
                categotyId = Integer.parseInt(Table_click);
                //categorie = BarApplication.getQueryManager().getCategorie(categotyId);
                BarApplication.getQueryManager().DeleteRow("categorie", "categorie_id", categotyId);
                RefreshCategorie();
            }
        }



    }//GEN-LAST:event_jButton35ActionPerformed

    private void jButton24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton24ActionPerformed
        // TODO add your handling code here:

        row = jTable_cursus1.getSelectedRow();
        if (row < 0) {
            JOptionPane.showMessageDialog(this, "Cursus is niet geselecteerd", "Cursus", JOptionPane.ERROR_MESSAGE);

        } else {
            String Table_click = (jTable_cursus1.getModel().getValueAt(row, 0).toString());
            cursusId = Integer.parseInt(Table_click);
            int id = BarApplication.getQueryManager().SelectRow("cursusrooster", "productnummer", cursusId);
            System.out.println("id=" + id);
            if (id > 0) {
                JOptionPane.showMessageDialog(this, "U kunt deze cursus niet verwijderen, hij is ingeroosterd", "Cursus", JOptionPane.ERROR_MESSAGE);
            } else {
                int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je dit cursus wil verwijderen", "verwijderen", JOptionPane.YES_NO_OPTION);
                if (WarningMessage == 0) {

                    BarApplication.getQueryManager().DeleteRow("product", "productnummer", cursusId);
                    Refreshcursus();

                }
            }
        }

    }//GEN-LAST:event_jButton24ActionPerformed

    private void jButton37ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton37ActionPerformed
        // TODO add your handling code here:

        row = jTable_Activiteit.getSelectedRow();
        if (row < 0) {
            JOptionPane.showMessageDialog(this, "Activiteit is niet geselecteerd", "Activiteit", JOptionPane.ERROR_MESSAGE);

        } else {
            String Table_click = (jTable_Activiteit.getModel().getValueAt(row, 0).toString());
            activiteitId = Integer.parseInt(Table_click);
            int id = BarApplication.getQueryManager().SelectRow("activiteitrooster", "idactiviteit", activiteitId);
            System.out.println("id=" + id);
            if (id > 0) {
                JOptionPane.showMessageDialog(this, "U kunt deze activiteit niet verwijderen, hij is ingeroosterd", "Activiteit", JOptionPane.ERROR_MESSAGE);
            } else {
                int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je dit Activiteit wil verwijderen", "verwijderen", JOptionPane.YES_NO_OPTION);
                if (WarningMessage == 0) {

                    BarApplication.getQueryManager().DeleteRow("activiteit", "idactiviteit", activiteitId);
                    tableActiviteit();

                }
            }
        }

    }//GEN-LAST:event_jButton37ActionPerformed

    private void jButton29ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton29ActionPerformed
        // TODO add your handling code here:


        row = jTable_cursusrooter.getSelectedRow();
        if (row < 0) {
            JOptionPane.showMessageDialog(this, "cursus is niet geselecteerd", "cursusrooster", JOptionPane.ERROR_MESSAGE);

        } else {
            String Table_click = (jTable_cursusrooter.getModel().getValueAt(row, 0).toString());
            activiteitId = Integer.parseInt(Table_click);
            int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je deze cursus wilt verwijderen uit het rooster", "verwijderen", JOptionPane.YES_NO_OPTION);
            if (WarningMessage == 0) {

                BarApplication.getQueryManager().DeleteRow("cursusrooster", "idcursusrooster", activiteitId);
               EmptyCususroosterField();

            }

        }
    }//GEN-LAST:event_jButton29ActionPerformed

    private void jButton_csvActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_csvActionPerformed

        if (jComboBox_jaar.getSelectedIndex() == 0) {
            JOptionPane.showMessageDialog(this, "Selecteer een jaar", "Jaar", JOptionPane.ERROR_MESSAGE);
        } else {
            if (jComboBox_maand.getSelectedIndex() == 0) {
                JOptionPane.showMessageDialog(this, "Selecteer een maand", "Maand", JOptionPane.ERROR_MESSAGE);
            } else {
                String jaar = jComboBox_jaar.getSelectedItem().toString();
                String maand = jComboBox_maand.getSelectedItem().toString();
                try {

                    BarApplication.getQueryManager().VerkoopCsvFiler(jaar, maand);

                } catch (Exception ex) {
                    System.out.println("Problemen bij generenen facturen: " + ex);
                }
                System.out.println("Done!");
            }
        }
    }//GEN-LAST:event_jButton_csvActionPerformed

    private void jButton41ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton41ActionPerformed
        // TODO add your handling code here:


        row = jTable_Activiteitrooster.getSelectedRow();
        if (row < 0) {
            JOptionPane.showMessageDialog(this, "Activiteit is niet geselecteerd", "activiteit", JOptionPane.ERROR_MESSAGE);

        } else {
            String Table_click = (jTable_Activiteitrooster.getModel().getValueAt(row, 0).toString());
            ActiviteitroosterId = Integer.parseInt(Table_click);
            int WarningMessage = JOptionPane.showConfirmDialog(this, "Weet je zeker dat je deze activiteit wilt verwijderen uit het rooster", "verwijderen", JOptionPane.YES_NO_OPTION);
            if (WarningMessage == 0) {

                BarApplication.getQueryManager().DeleteRow("activiteitrooster", "idactiviteitrooster", ActiviteitroosterId);
                 EmptyActiviteitrooster();
            }


        }
    }//GEN-LAST:event_jButton41ActionPerformed

    private void jComboBox_ActivityMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_ActivityMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox_ActivityMouseClicked

    private void jTabbedPane3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane3MouseClicked
        // TODO add your handling code here:
        System.out.println(evt.getClickCount());
        if (evt.getClickCount() == 1) {
            jComboBox_Activity.removeAllItems();
            addActivitytemsTocomboBoX();
        }
    }//GEN-LAST:event_jTabbedPane3MouseClicked

    private void jTabbedPane2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane2MouseClicked
        // TODO add your handling code here:
        if (evt.getClickCount() == 1) {
            jComboBox_cursusnaam.removeAllItems();
            addCoursesItemsTocomboBoX();
        }
    }//GEN-LAST:event_jTabbedPane2MouseClicked
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Personalia_JPanel;
    private javax.swing.JPanel Personalia_JPanel3;
    private javax.swing.JPanel Personalia_JPanel5;
    private javax.swing.JPanel Personalia_JPanel6;
    private javax.swing.JPanel Personalia_JPanel7;
    private javax.swing.JLabel bar;
    private javax.swing.JLabel factuur;
    private javax.swing.JLabel home;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton24;
    private javax.swing.JButton jButton25;
    private javax.swing.JButton jButton27;
    private javax.swing.JButton jButton28;
    private javax.swing.JButton jButton29;
    private javax.swing.JButton jButton30;
    private javax.swing.JButton jButton35;
    private javax.swing.JButton jButton37;
    private javax.swing.JButton jButton38;
    private javax.swing.JButton jButton40;
    private javax.swing.JButton jButton41;
    private javax.swing.JButton jButton_Categorie;
    private javax.swing.JButton jButton_Save;
    private javax.swing.JButton jButton_SaveCursus1;
    private javax.swing.JButton jButton_SaveCursus2;
    private javax.swing.JButton jButton_SaveProduct;
    private javax.swing.JButton jButton_add_activity;
    private javax.swing.JButton jButton_add_activityrooster;
    private javax.swing.JButton jButton_csv;
    private javax.swing.JButton jButton_newProduct;
    private javax.swing.JButton jButton_save_Activity;
    private javax.swing.JButton jButton_save_Activityrooster;
    private javax.swing.JCheckBox jCheckBox_Alkamaar;
    private javax.swing.JCheckBox jCheckBox_Haarlem;
    public javax.swing.JCheckBox jCheckBox_Man;
    private javax.swing.JCheckBox jCheckBox_Purmerend;
    public javax.swing.JCheckBox jCheckBox_Vrouw;
    private javax.swing.JComboBox jComboBox_Activity;
    public javax.swing.JComboBox jComboBox_Dag;
    public javax.swing.JComboBox jComboBox_Jaar;
    public javax.swing.JComboBox jComboBox_Maand;
    private javax.swing.JComboBox jComboBox_ProductenCategorie;
    private javax.swing.JComboBox jComboBox_Studio;
    private javax.swing.JComboBox jComboBox_Studio_cursus;
    private javax.swing.JComboBox jComboBox_Vestiging;
    private javax.swing.JComboBox jComboBox_categorie;
    private javax.swing.JComboBox jComboBox_cursusnaam;
    private javax.swing.JComboBox jComboBox_dag_Activity;
    private javax.swing.JComboBox jComboBox_dagen;
    private javax.swing.JComboBox jComboBox_functie;
    private javax.swing.JComboBox jComboBox_jaar;
    private javax.swing.JComboBox jComboBox_maand;
    private javax.swing.JComboBox jComboBox_vestiging_curusus;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel79;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel80;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel32;
    private javax.swing.JPanel jPanel34;
    private javax.swing.JPanel jPanel36;
    private javax.swing.JPanel jPanel38;
    private javax.swing.JPanel jPanel45;
    private javax.swing.JPanel jPanel46;
    private javax.swing.JPanel jPanel47;
    private javax.swing.JPanel jPanel48;
    private javax.swing.JPanel jPanel49;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel50;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel jPanel_functie;
    public javax.swing.JPanel jPanel_menu;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JTable jTable_Activiteit;
    private javax.swing.JTable jTable_Activiteitrooster;
    private javax.swing.JTable jTable_Product;
    private javax.swing.JTable jTable_Staff;
    private javax.swing.JTable jTable_categorie;
    private javax.swing.JTable jTable_cursus1;
    private javax.swing.JTable jTable_cursusrooter;
    private javax.swing.JTextArea jTextArea_Activity;
    private javax.swing.JTextArea jTextArea_categorie;
    private javax.swing.JTextArea jTextArea_cursus;
    private javax.swing.JTextArea jTextArea_productBeschr;
    private javax.swing.JTextField jTextField18;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField9;
    public javax.swing.JTextField jTextField_Achternaam;
    private javax.swing.JTextField jTextField_Activity;
    private javax.swing.JTextField jTextField_Categorie;
    private javax.swing.JTextField jTextField_Cursus_Prijs;
    private javax.swing.JTextField jTextField_MaxAantal;
    private javax.swing.JTextField jTextField_Mobilenummer;
    private javax.swing.JTextField jTextField_Prodductnaam;
    private javax.swing.JTextField jTextField_Tijd;
    public javax.swing.JTextField jTextField_Tussenvoegsel;
    private javax.swing.JTextField jTextField_begintijd;
    private javax.swing.JTextField jTextField_cursusnaam;
    private javax.swing.JTextField jTextField_eindtijd;
    private javax.swing.JTextField jTextField_email;
    private javax.swing.JTextField jTextField_endtijd;
    public javax.swing.JTextField jTextField_medewerkerId;
    public javax.swing.JTextField jTextField_voornaam;
    private javax.swing.JPasswordField jTextField_wachtwoord;
    private org.jdesktop.swingx.JXDatePicker jXDatePicker_Begindatun_Activity;
    private org.jdesktop.swingx.JXDatePicker jXDatePicker_Begingdatum;
    private org.jdesktop.swingx.JXDatePicker jXDatePicker_Einddatun_Activity;
    private org.jdesktop.swingx.JXDatePicker jXDatePicker_eniddatum;
    private javax.swing.JLabel leden;
    private javax.swing.JTextField prijs_TF;
    // End of variables declaration//GEN-END:variables
}
